summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/qthelper.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 0628dd2e3..ad1780144 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -1026,6 +1026,20 @@ void read_hashes()
stream >> thumbnailCache;
hashfile.close();
}
+ localFilenameOf.remove("");
+ QMutableHashIterator<QString, QByteArray> iter(hashOf);
+ while (iter.hasNext()) {
+ iter.next();
+ if (iter.value().isEmpty())
+ iter.remove();
+ }
+ qDebug() << "localFilenameOf empty" << localFilenameOf[""];
+
+ QHash<QString, QImage>::const_iterator i = thumbnailCache.constBegin();
+ while (i != thumbnailCache.constEnd()) {
+ qDebug() << i.key() << *i;
+ ++i;
+ }
}
void write_hashes()
@@ -1046,6 +1060,8 @@ void write_hashes()
void add_hash(const QString filename, QByteArray hash)
{
+ if (hash.isEmpty())
+ return;
QMutexLocker locker(&hashOfMutex);
hashOf[filename] = hash;
localFilenameOf[hash] = filename;