From 6b3b50cc2f8083ebbc013c1d270c1ec1d1252a23 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Mon, 2 Mar 2015 16:18:16 +0100 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/divepicturewidget.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'qt-ui/divepicturewidget.h') 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 #include #include +#include typedef QPair 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: -- cgit v1.2.3-70-g09d2