subsurface/subsurface-core/imagedownloader.h
Dirk Hohndel 9edb4f3fa9 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>
2015-11-06 11:30:11 -08:00

29 lines
530 B
C++

#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