diff options
author | Robert C. Helling <helling@atdotde.de> | 2015-03-02 16:18:16 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-03-16 12:42:36 -0700 |
commit | 6b3b50cc2f8083ebbc013c1d270c1ec1d1252a23 (patch) | |
tree | 634abaf36f1908b24f6128c1c02c31b3eba6360e /qt-ui/divepicturewidget.h | |
parent | 869ddc915daf4616ee2e010ab06fa7802b7e6d5f (diff) | |
download | subsurface-6b3b50cc2f8083ebbc013c1d270c1ec1d1252a23.tar.gz |
Load remote images
When loading an image by filename and by hash fails, try to interpret
the filename as URL and download the image.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divepicturewidget.h')
-rw-r--r-- | qt-ui/divepicturewidget.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/qt-ui/divepicturewidget.h b/qt-ui/divepicturewidget.h index 506f85bf8..2ce228daf 100644 --- a/qt-ui/divepicturewidget.h +++ b/qt-ui/divepicturewidget.h @@ -5,6 +5,7 @@ #include <QListView> #include <QThread> #include <QFuture> +#include <QNetworkReply> typedef QPair<QString, QByteArray> SHashedFilename; @@ -18,6 +19,18 @@ public: SHashedImage(struct picture *picture); }; +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 DivePictureModel : public QAbstractTableModel { Q_OBJECT public: |