aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--subsurface-core/qthelper.cpp6
-rw-r--r--subsurface-core/qthelper.h1
2 files changed, 2 insertions, 5 deletions
diff --git a/subsurface-core/qthelper.cpp b/subsurface-core/qthelper.cpp
index 4efe57bd4..915f2636c 100644
--- a/subsurface-core/qthelper.cpp
+++ b/subsurface-core/qthelper.cpp
@@ -1014,11 +1014,7 @@ QString fileFromHash(char *hash)
void updateHash(struct picture *picture) {
QByteArray hash = hashFile(fileFromHash(picture->hash));
- QMutexLocker locker(&hashOfMutex);
- hashOf[QString(picture->filename)] = hash;
- char *old = picture->hash;
- picture->hash = strdup(hash.toHex());
- free(old);
+ learnHash(picture, hash);
}
void hashPicture(struct picture *picture)
diff --git a/subsurface-core/qthelper.h b/subsurface-core/qthelper.h
index 842e40c36..09073e25b 100644
--- a/subsurface-core/qthelper.h
+++ b/subsurface-core/qthelper.h
@@ -25,6 +25,7 @@ void updateHash(struct picture *picture);
QByteArray hashFile(const QString filename);
void learnImages(const QDir dir, int max_recursions, bool recursed);
void add_hash(const QString filename, QByteArray hash);
+void hashPicture(struct picture *picture);
QString localFilePath(const QString originalFilename);
QString fileFromHash(char *hash);
void learnHash(struct picture *picture, QByteArray hash);