2018-08-19 19:02:49 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QFile>
|
|
|
|
#include <QNetworkAccessManager>
|
|
|
|
#include <QNetworkReply>
|
|
|
|
#include <QNetworkRequest>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class DownloadManager : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2018-08-26 13:49:15 +02:00
|
|
|
explicit DownloadManager(QObject *parent = nullptr);
|
2018-08-19 19:02:49 +02:00
|
|
|
virtual ~DownloadManager();
|
|
|
|
void setFile(QString fileURL, const QString &channelName);
|
|
|
|
|
|
|
|
private:
|
2021-11-27 14:06:41 +01:00
|
|
|
QNetworkAccessManager *manager_;
|
|
|
|
QNetworkReply *reply_;
|
|
|
|
QFile *file_;
|
2018-08-19 19:02:49 +02:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void onDownloadProgress(qint64, qint64);
|
|
|
|
void onFinished(QNetworkReply *);
|
|
|
|
void onReadyRead();
|
|
|
|
void onReplyFinished();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void downloadComplete();
|
|
|
|
};
|
2021-11-27 14:06:41 +01:00
|
|
|
|
2018-08-19 19:02:49 +02:00
|
|
|
} // namespace chatterino
|