mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
In imagedownloader.cpp the only thing we need from the picture struct is the filename. Therefore, use QStrings instead of the picture struct. This simplifies memory management. Remove the clone_picture() function, which is not needed anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
23 lines
504 B
C++
23 lines
504 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef IMAGEDOWNLOADER_H
|
|
#define IMAGEDOWNLOADER_H
|
|
|
|
#include <QImage>
|
|
#include <QFuture>
|
|
#include <QNetworkReply>
|
|
|
|
class ImageDownloader : public QObject {
|
|
Q_OBJECT
|
|
public:
|
|
ImageDownloader(const QString &filename);
|
|
void load(bool fromHash);
|
|
|
|
private:
|
|
bool loadFromUrl(const QUrl &); // return true on success
|
|
void saveImage(QNetworkReply *reply, bool &success);
|
|
QString filename;
|
|
};
|
|
|
|
QImage getHashedImage(const QString &filename);
|
|
|
|
#endif // IMAGEDOWNLOADER_H
|