forked from Flowee/registry
34 lines
591 B
C++
34 lines
591 B
C++
#ifndef DOWNLOADJOB_H
|
|
#define DOWNLOADJOB_H
|
|
|
|
#include <QObject>
|
|
#include <QUrl>
|
|
|
|
class QNetworkAccessManager;
|
|
class QNetworkReply;
|
|
|
|
class DownloadJob : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit DownloadJob(QNetworkAccessManager *parent = nullptr);
|
|
|
|
void start();
|
|
|
|
void setSourceUrl(const QUrl &newSourceUrl);
|
|
QUrl sourceUrl() const;
|
|
void setTargetFilePath(const QString &newTargetFilePath);
|
|
QString targetFilePath() const;
|
|
|
|
signals:
|
|
void finished();
|
|
|
|
private:
|
|
QString m_targetFilePath;
|
|
QUrl m_sourceUrl;
|
|
|
|
QNetworkAccessManager *m_net;
|
|
};
|
|
|
|
#endif
|