summaryrefslogtreecommitdiffstats
path: root/core/imagedownloader.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-06-10 16:39:47 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-07-04 02:27:36 +0800
commitf3ef38ca0d6db6f7e022a0e565f7460ed22f431e (patch)
tree66a331547c00a48f2a15882f3f7d22307866f120 /core/imagedownloader.cpp
parent0646b41275a3f38926c75d2746b3208805da3a23 (diff)
downloadsubsurface-f3ef38ca0d6db6f7e022a0e565f7460ed22f431e.tar.gz
Dive pictures: remove hashes
In the last commits, the canonical-to-local filename map was made independent from the image hashes and the location of moved images was based on filename not hashes. The hashes are now in principle unused (except for conversion of old-style local filename lookups). Therefore, remove the hashes in this commit. This makes addition of images distinctly faster. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/imagedownloader.cpp')
-rw-r--r--core/imagedownloader.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/core/imagedownloader.cpp b/core/imagedownloader.cpp
index c201e28fe..1cdef0b52 100644
--- a/core/imagedownloader.cpp
+++ b/core/imagedownloader.cpp
@@ -61,7 +61,6 @@ void ImageDownloader::saveImage(QNetworkReply *reply)
imageFile.waitForBytesWritten(-1);
imageFile.close();
learnPictureFilename(filename, imageFile.fileName());
- hashPicture(filename); // hashPicture transforms canonical into local filename
}
emit loaded(filename);
}
@@ -83,10 +82,6 @@ static std::pair<QImage, bool> fetchImage(const QString &filename, const QString
QUrl url = QUrl::fromUserInput(filename);
if (url.isLocalFile()) {
thumb.load(url.toLocalFile());
- // If we loaded successfully, make sure the hash is up to date.
- // Note that hashPicture() takes the *original* filename.
- if (!thumb.isNull())
- hashPicture(originalFilename);
} else if (tryDownload) {
// This has to be done in UI main thread, because QNetworkManager refuses
// to treat requests from other threads. invokeMethod() is Qt's way of calling a
@@ -247,8 +242,7 @@ void Thumbnailer::processItem(QString filename, bool tryDownload)
void Thumbnailer::imageDownloaded(QString filename)
{
- // Image was downloaded and the filename connected with a hash.
- // Try thumbnailing again.
+ // Image was downloaded -> try thumbnailing again.
QMutexLocker l(&lock);
workingOn[filename] = QtConcurrent::run(&pool, [this, filename]() { processItem(filename, false); });
}