diff options
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; |