2017-04-27 18:24:53 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2015-11-06 18:39:59 +00:00
|
|
|
#ifndef IMAGEDOWNLOADER_H
|
|
|
|
#define IMAGEDOWNLOADER_H
|
|
|
|
|
|
|
|
#include <QImage>
|
|
|
|
#include <QFuture>
|
|
|
|
#include <QNetworkReply>
|
|
|
|
|
|
|
|
class ImageDownloader : public QObject {
|
|
|
|
Q_OBJECT;
|
|
|
|
public:
|
|
|
|
ImageDownloader(struct picture *picture);
|
2016-03-15 20:31:59 +00:00
|
|
|
~ImageDownloader();
|
2016-01-09 15:29:49 +00:00
|
|
|
void load(bool fromHash);
|
2015-11-06 18:39:59 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
struct picture *picture;
|
|
|
|
QNetworkAccessManager manager;
|
2016-03-15 21:45:17 +00:00
|
|
|
bool loadFromHash;
|
2015-11-06 18:39:59 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void saveImage(QNetworkReply *reply);
|
|
|
|
};
|
|
|
|
|
|
|
|
class SHashedImage : public QImage {
|
|
|
|
public:
|
|
|
|
SHashedImage(struct picture *picture);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // IMAGEDOWNLOADER_H
|