summaryrefslogtreecommitdiffstats
path: root/core/imagedownloader.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-05-16 00:17:04 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-05-16 02:01:26 +0300
commitc3c2c2f606268e1fd5c12268ee6ccdebc6d4653c (patch)
tree556035a3ae45043bda5158495bb1cc74b6ca4f19 /core/imagedownloader.h
parentf4d569d89d53197f83ac8a7164439932fb0fb277 (diff)
downloadsubsurface-c3c2c2f606268e1fd5c12268ee6ccdebc6d4653c.tar.gz
Dive pictures: Don't enter infinity loop on invalid pictures
The recently committed refactoring of the dive-picture code introduced a severe bug: If an image couldn't be loaded from disk owing to an invalid file, the filename was interpreted as an url and loaded in the background. This succeeded, because the file actually exists. After download, the file would then still be invalid and the whole thing restarted, leading to an infinity loop. To fix this, do two things: 1) Don't even try to download local files. 2) If interpreting a downloaded file fails, don't try the downloading business again. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/imagedownloader.h')
-rw-r--r--core/imagedownloader.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/imagedownloader.h b/core/imagedownloader.h
index bee262854..3c316a2f6 100644
--- a/core/imagedownloader.h
+++ b/core/imagedownloader.h
@@ -46,7 +46,7 @@ signals:
void thumbnailChanged(QString filename, QImage thumbnail);
private:
Thumbnailer();
- void processItem(QString filename);
+ void processItem(QString filename, bool tryDownload);
mutable QMutex lock;
QThreadPool pool;