diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-08-28 16:52:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-28 16:52:53 +0200 |
commit | f371ec210c091b9ebc91930be74752383cb941c6 (patch) | |
tree | f3b13e1015285e76145552d21503ff641bf4ce11 /launcher/minecraft/mod/tasks/LocalModParseTask.h | |
parent | afcd669d2f6934c2b6076939d7665f791d495994 (diff) | |
parent | 0b81b283bfdd16b409127f22eac7b51ce0142929 (diff) | |
download | PrismLauncher-f371ec210c091b9ebc91930be74752383cb941c6.tar.gz PrismLauncher-f371ec210c091b9ebc91930be74752383cb941c6.tar.bz2 PrismLauncher-f371ec210c091b9ebc91930be74752383cb941c6.zip |
Merge pull request #1052 from flowln/resource_model
Diffstat (limited to 'launcher/minecraft/mod/tasks/LocalModParseTask.h')
-rw-r--r-- | launcher/minecraft/mod/tasks/LocalModParseTask.h | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/launcher/minecraft/mod/tasks/LocalModParseTask.h b/launcher/minecraft/mod/tasks/LocalModParseTask.h index ed92394c..4bbf3c85 100644 --- a/launcher/minecraft/mod/tasks/LocalModParseTask.h +++ b/launcher/minecraft/mod/tasks/LocalModParseTask.h @@ -2,29 +2,31 @@ #include <QDebug> #include <QObject> -#include <QRunnable> #include "minecraft/mod/Mod.h" #include "minecraft/mod/ModDetails.h" -class LocalModParseTask : public QObject, public QRunnable +#include "tasks/Task.h" + +class LocalModParseTask : public Task { Q_OBJECT public: struct Result { - QString id; - std::shared_ptr<ModDetails> details; + ModDetails details; }; using ResultPtr = std::shared_ptr<Result>; ResultPtr result() const { return m_result; } - LocalModParseTask(int token, Mod::ModType type, const QFileInfo & modFile); - void run(); + [[nodiscard]] bool canAbort() const override { return true; } + bool abort() override; + + LocalModParseTask(int token, ResourceType type, const QFileInfo & modFile); + void executeTask() override; -signals: - void finished(int token); + [[nodiscard]] int token() const { return m_token; } private: void processAsZip(); @@ -33,7 +35,9 @@ private: private: int m_token; - Mod::ModType m_type; + ResourceType m_type; QFileInfo m_modFile; ResultPtr m_result; + + bool m_aborted = false; }; |