summaryrefslogtreecommitdiffstats
path: root/core/imagedownloader.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-02-08 22:45:55 +0100
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2018-03-05 18:04:57 +0200
commit117f4a0d7d75bcbd2aa33b293f3d16f8a07ed9e1 (patch)
treeae068eae422fb27d2e88b8c0b52a0eb07d2b775b /core/imagedownloader.h
parent54d56a74aaa8d09c801a1a73989a1d5d95a72795 (diff)
downloadsubsurface-117f4a0d7d75bcbd2aa33b293f3d16f8a07ed9e1.tar.gz
core/imagedownloader.cpp: remove recursion
If loading from hash failed in the saveImage() slot(!) it would recurse into loadFromUrl(), which would generate a new network reply. Very scary and a (small) wonder that it worked. Let's try to make this all more explicit. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/imagedownloader.h')
-rw-r--r--core/imagedownloader.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/imagedownloader.h b/core/imagedownloader.h
index 295b664f4..be196aaef 100644
--- a/core/imagedownloader.h
+++ b/core/imagedownloader.h
@@ -14,11 +14,9 @@ public:
void load(bool fromHash);
private:
+ bool loadFromUrl(const QUrl &); // return true on success
+ void saveImage(QNetworkReply *reply, bool &success);
struct picture *picture;
- bool loadFromHash;
-
-private slots:
- void saveImage(QNetworkReply *reply);
};
class SHashedImage : public QImage {