diff options
author | swirl <swurl@swurl.xyz> | 2022-02-03 13:53:30 -0500 |
---|---|---|
committer | swirl <swurl@swurl.xyz> | 2022-02-03 13:53:30 -0500 |
commit | e8a4902a3dddd08d65bd1284951ae5954439d1f5 (patch) | |
tree | b5936e950cf149366366db156f90e51c25f2257a /launcher/ModDownloadTask.h | |
parent | fcc4420cfec3fcd970ff1f35b8848559c7b5b6ef (diff) | |
parent | e2952061af24e0b9a4639d5ff1eb24c57f65830a (diff) | |
download | PrismLauncher-e8a4902a3dddd08d65bd1284951ae5954439d1f5.tar.gz PrismLauncher-e8a4902a3dddd08d65bd1284951ae5954439d1f5.tar.bz2 PrismLauncher-e8a4902a3dddd08d65bd1284951ae5954439d1f5.zip |
Merge branch 'feature/download_mods' into develop
Diffstat (limited to 'launcher/ModDownloadTask.h')
-rw-r--r-- | launcher/ModDownloadTask.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/launcher/ModDownloadTask.h b/launcher/ModDownloadTask.h new file mode 100644 index 00000000..7e4f1b7d --- /dev/null +++ b/launcher/ModDownloadTask.h @@ -0,0 +1,34 @@ +#pragma once +#include "QObjectPtr.h" +#include "tasks/Task.h" +#include "minecraft/mod/ModFolderModel.h" +#include "net/NetJob.h" +#include <QUrl> + + +class ModDownloadTask : public Task { + Q_OBJECT +public: + explicit ModDownloadTask(const QUrl sourceUrl, const QString filename, const std::shared_ptr<ModFolderModel> mods); + +public slots: + bool abort() override; +protected: + //! Entry point for tasks. + void executeTask() override; + +private: + QUrl m_sourceUrl; + NetJob::Ptr m_filesNetJob; + const std::shared_ptr<ModFolderModel> mods; + const QString filename; + + void downloadProgressChanged(qint64 current, qint64 total); + + void downloadFailed(QString reason); + + void downloadSucceeded(); +}; + + + |