mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
82c87204e4
Of course, as of this writing, there are no images on the server. In addition, this patch adds comments to explain the by now convoluted image retrieval logic (local file, filename as URL, by hash, cloud server). Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
32 lines
590 B
C++
32 lines
590 B
C++
#ifndef IMAGEDOWNLOADER_H
|
|
#define IMAGEDOWNLOADER_H
|
|
|
|
#include <QImage>
|
|
#include <QFuture>
|
|
#include <QNetworkReply>
|
|
|
|
typedef QPair<QString, QByteArray> SHashedFilename;
|
|
|
|
extern QUrl cloudImageURL(const char *hash);
|
|
|
|
|
|
class ImageDownloader : public QObject {
|
|
Q_OBJECT;
|
|
public:
|
|
ImageDownloader(struct picture *picture);
|
|
void load(bool fromHash);
|
|
|
|
private:
|
|
struct picture *picture;
|
|
QNetworkAccessManager manager;
|
|
|
|
private slots:
|
|
void saveImage(QNetworkReply *reply);
|
|
};
|
|
|
|
class SHashedImage : public QImage {
|
|
public:
|
|
SHashedImage(struct picture *picture);
|
|
};
|
|
|
|
#endif // IMAGEDOWNLOADER_H
|