diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-10-26 18:12:33 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-10-26 18:21:25 +0200 |
commit | 1b4851a941cbafb7bf7a45feee7149cefa7e0acb (patch) | |
tree | 6626a47c9d2f2b4a37302b0e036ab1ffc5033f3f /api/logic/InstanceCopyTask.h | |
parent | d66fdcd4cc6913508d2987c14cd9fc4d6760b8a5 (diff) | |
download | MultiMC-1b4851a941cbafb7bf7a45feee7149cefa7e0acb.tar MultiMC-1b4851a941cbafb7bf7a45feee7149cefa7e0acb.tar.gz MultiMC-1b4851a941cbafb7bf7a45feee7149cefa7e0acb.tar.lz MultiMC-1b4851a941cbafb7bf7a45feee7149cefa7e0acb.tar.xz MultiMC-1b4851a941cbafb7bf7a45feee7149cefa7e0acb.zip |
NOISSUE use QtConcurrent to run FS operations in worker threads
Not all operations - only the ones that aren't in error handling.
The API for QFuture is too nasty to do much more in a sensible way.
Diffstat (limited to 'api/logic/InstanceCopyTask.h')
-rw-r--r-- | api/logic/InstanceCopyTask.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/api/logic/InstanceCopyTask.h b/api/logic/InstanceCopyTask.h index a663ddbd..1ecf8313 100644 --- a/api/logic/InstanceCopyTask.h +++ b/api/logic/InstanceCopyTask.h @@ -4,10 +4,13 @@ #include "multimc_logic_export.h" #include "net/NetJob.h" #include <QUrl> +#include <QFuture> +#include <QFutureWatcher> #include "settings/SettingsObject.h" #include "BaseVersion.h" #include "BaseInstance.h" + class BaseInstanceProvider; class MULTIMC_LOGIC_EXPORT InstanceCopyTask : public Task @@ -20,6 +23,8 @@ public: protected: //! Entry point for tasks. virtual void executeTask() override; + void copyFinished(); + void copyAborted(); private: /* data */ SettingsObjectPtr m_globalSettings; @@ -28,7 +33,10 @@ private: /* data */ QString m_instName; QString m_instIcon; QString m_instGroup; + QString m_stagingPath; bool m_copySaves = false; + QFuture<bool> m_copyFuture; + QFutureWatcher<bool> m_copyFutureWatcher; }; |