diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-05-23 18:01:39 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-05-24 08:27:10 -0700 |
commit | 21ee440e5f96a2f7ddc810ced89f9ea1e7174bae (patch) | |
tree | ea40810cc8bb86ec149ab6968163fe8a368e66e3 /core/qthelper.cpp | |
parent | 0958592ee6e0ea2016906d3fb84b64e3c20a90fa (diff) | |
download | subsurface-21ee440e5f96a2f7ddc810ced89f9ea1e7174bae.tar.gz |
Cleanup: remove code related to picture-storage in git repositories
Saving of pictures to git repositories was disabled. Finally remove
this code and the corresponding load code.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r-- | core/qthelper.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp index b44ef7d6f..11d74a14e 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -1293,15 +1293,6 @@ extern "C" const char *local_file_path(struct picture *picture) return copy_qstring(localFilePath(picture->filename)); } -extern "C" bool picture_exists(struct picture *picture) -{ - QString localPath = localFilePath(picture->filename); - if (localPath.isEmpty()) - return false; - QByteArray hash = hashFile(localPath); - return !hash.isEmpty() && getHash(QString(picture->filename)) == hash; -} - const QString picturedir() { return QString(system_default_directory()).append("/picturedata/"); @@ -1312,25 +1303,6 @@ extern "C" char *picturedir_string() return copy_qstring(picturedir()); } -/* when we get a picture from git storage (local or remote) and can't find the picture - * based on its hash, we create a local copy with the hash as filename and the appropriate - * suffix */ -extern "C" void savePictureLocal(struct picture *picture, const char *hash, const char *data, int len) -{ - QString dirname = picturedir(); - QDir localPictureDir(dirname); - localPictureDir.mkpath(dirname); - QString suffix(picture->filename); - suffix.replace(QRegularExpression(".*\\."), ""); - QString filename(dirname + hash + "." + suffix); - QSaveFile out(filename); - if (out.open(QIODevice::WriteOnly)) { - out.write(data, len); - out.commit(); - add_hash(filename, QByteArray::fromHex(hash)); - } -} - QString get_gas_string(struct gasmix gas) { uint o2 = (get_o2(&gas) + 5) / 10, he = (get_he(&gas) + 5) / 10; |