2017-09-19 04:46:49 +00:00
|
|
|
#ifndef TASKTASIX_H
|
|
|
|
#define TASKTASIX_H
|
|
|
|
|
2017-09-21 13:24:45 +00:00
|
|
|
#include "taskworker.h"
|
2017-09-19 08:35:43 +00:00
|
|
|
|
2017-10-25 09:51:35 +00:00
|
|
|
class HttpDownloader;
|
2017-09-19 04:46:49 +00:00
|
|
|
|
2017-09-21 13:24:45 +00:00
|
|
|
class TaskTasix : public TaskWorker
|
2017-09-19 04:46:49 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-09-21 13:24:45 +00:00
|
|
|
explicit TaskTasix(QObject *parent = nullptr);
|
2017-09-19 04:46:49 +00:00
|
|
|
|
2017-10-25 09:51:35 +00:00
|
|
|
HttpDownloader *downloader() const { return m_downloader; }
|
|
|
|
|
2017-10-25 09:55:42 +00:00
|
|
|
static QString parseTasixBuffer(const QByteArray &buffer);
|
2017-10-25 09:51:35 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void startDownloader() const;
|
|
|
|
|
2017-10-25 09:55:42 +00:00
|
|
|
virtual QString parseBuffer(const QByteArray &buffer) const {
|
|
|
|
return parseTasixBuffer(buffer);
|
2017-10-25 09:51:35 +00:00
|
|
|
}
|
2017-09-19 04:46:49 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
2017-09-19 08:35:43 +00:00
|
|
|
void run() override;
|
2017-09-21 13:24:45 +00:00
|
|
|
void cancel(bool success = false) override;
|
|
|
|
|
|
|
|
bool processResult(FortManager *fortManager) override;
|
2017-09-19 04:46:49 +00:00
|
|
|
|
|
|
|
private slots:
|
2017-10-25 09:51:35 +00:00
|
|
|
void downloadFinished(bool success);
|
2017-09-19 04:46:49 +00:00
|
|
|
|
|
|
|
private:
|
2017-10-25 09:51:35 +00:00
|
|
|
HttpDownloader *m_downloader;
|
2017-09-19 04:46:49 +00:00
|
|
|
|
2017-10-03 09:29:54 +00:00
|
|
|
QString m_rangeText;
|
2017-09-19 04:46:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TASKTASIX_H
|