mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
bb566f7798
commit
9edb4f3fa9
7 changed files with 110 additions and 93 deletions
29
subsurface-core/imagedownloader.h
Normal file
29
subsurface-core/imagedownloader.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
#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
|
Loading…
Add table
Add a link
Reference in a new issue