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.
This commit is contained in:
Petr Mrázek
2016-10-26 18:12:33 +02:00
parent d66fdcd4cc
commit 1b4851a941
7 changed files with 70 additions and 19 deletions

View File

@ -4,6 +4,8 @@
#include "multimc_logic_export.h"
#include "net/NetJob.h"
#include <QUrl>
#include <QFuture>
#include <QFutureWatcher>
#include "settings/SettingsObject.h"
class BaseInstanceProvider;
@ -26,6 +28,8 @@ private slots:
void downloadSucceeded();
void downloadFailed(QString reason);
void downloadProgressChanged(qint64 current, qint64 total);
void extractFinished();
void extractAborted();
private: /* data */
SettingsObjectPtr m_globalSettings;
@ -37,4 +41,7 @@ private: /* data */
QString m_instName;
QString m_instIcon;
QString m_instGroup;
QString m_stagingPath;
QFuture<QStringList> m_extractFuture;
QFutureWatcher<QStringList> m_extractFutureWatcher;
};