diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-11-06 10:39:59 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-11-06 11:30:11 -0800 |
commit | 9edb4f3fa91b3907809375794d75a1b1a77c94a0 (patch) | |
tree | cd3b194081d0b928c5cb56aed0df7b9bc469fdd7 /subsurface-core/imagedownloader.h | |
parent | bb566f7798f1bc7fe8e4d40813823dca0f6ea9a3 (diff) | |
download | subsurface-9edb4f3fa91b3907809375794d75a1b1a77c94a0.tar.gz |
Move ImageDownloader out of the desktop widgets
This required a bit more untangling, but with this it seems we can build
subsurface-mobile again (at least on the desktop).
Interesting is the removal from inside the ImageDownloader of the call to
DivePictureModel::instance()->updateDivePictures() - which actually could
cause some interesting recursion issues. If it turns out we did indeed
need this, it needs to be re-architected.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/imagedownloader.h')
-rw-r--r-- | subsurface-core/imagedownloader.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/subsurface-core/imagedownloader.h b/subsurface-core/imagedownloader.h new file mode 100644 index 000000000..fd6a91158 --- /dev/null +++ b/subsurface-core/imagedownloader.h @@ -0,0 +1,29 @@ +#ifndef IMAGEDOWNLOADER_H +#define IMAGEDOWNLOADER_H + +#include <QImage> +#include <QFuture> +#include <QNetworkReply> + +typedef QPair<QString, QByteArray> SHashedFilename; + +class ImageDownloader : public QObject { + Q_OBJECT; +public: + ImageDownloader(struct picture *picture); + void load(); + +private: + struct picture *picture; + QNetworkAccessManager manager; + +private slots: + void saveImage(QNetworkReply *reply); +}; + +class SHashedImage : public QImage { +public: + SHashedImage(struct picture *picture); +}; + +#endif // IMAGEDOWNLOADER_H |