]> git.sur5r.net Git - minitube/blob - lib/updater/src/impl/downloader.h
New upstream version 3.5
[minitube] / lib / updater / src / impl / downloader.h
1 #ifndef UPDATER_IMPL_DOWNLOADER_H
2 #define UPDATER_IMPL_DOWNLOADER_H
3
4 #include <QtNetwork>
5
6 #include "http.h"
7
8 namespace updater {
9
10 class Downloader : public QObject {
11     Q_OBJECT
12
13 public:
14     void download(const QUrl &url);
15     void stop();
16
17 signals:
18     void progress(int percent);
19     void error(const QString &message);
20     void fileReady(const QString &filename);
21
22 private:
23     QNetworkReply *reply = nullptr;
24     QFile file;
25 };
26
27 } // namespace updater
28
29 #endif // UPDATER_IMPL_DOWNLOADER_H