/* * filedownloader.h * * Created on: Mar 7, 2014 * Author: nils */ #ifndef FILEDOWNLOADER_H_ #define FILEDOWNLOADER_H_ #include #include #include #include #include class FileDownloader : public QObject { Q_OBJECT public: explicit FileDownloader(const QUrl& fileUrl, QObject *parent = nullptr); virtual ~FileDownloader(); bool downloadFile(); signals: /** * Triggered when the download has finished. * On error, downloadedData will be empty. */ void downloaded(const QUrl& url, const QByteArray& downloadedData); private slots: void fileDownloaded(); void downloadFailed(QNetworkReply::NetworkError code); void downloadProgress(qint64 received, qint64 totalSize); private: void killReply(QNetworkReply *reply); bool started; QUrl url; }; #endif /* FILEDOWNLOADER_H_ */