mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
869ddc915d
commit
6b3b50cc2f
5 changed files with 107 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue