diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-01-25 14:26:34 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-01-31 16:10:01 +0000 |
commit | 966f4ea6a9d1e46833fc30df878ba6fa8f919988 (patch) | |
tree | 7f37c2adcf4dd6fe002585fb3b3c2815b21c5f26 /src/plugins/qbsprojectmanager/qbsinstallstep.h | |
parent | 536618b012b44b5ced428fc39600931803d5dd44 (diff) | |
download | qt-creator-966f4ea6a9d1e46833fc30df878ba6fa8f919988.tar.gz |
ProjectExplorer: Rework the build step run interface
Originally, the build manager used to run all build steps in a dedicated
thread. Communication between the step and the manager happened via a
QFutureInterface that was passed into the step's run() function.
Later, new steps were added that operated asynchronously, so the build
manager had to differentiate between the different kinds of steps for
starting and stopping.
These days, almost all build and deploy steps work asynchronously, which
made the QFuture-based interface look increasingly odd.
With this patch, all build steps are expected to work asynchronously, so
the build manager no longer needs to differentiate. Steps are started
and requested to stop via the run() and cancel() functions,
respectively, and emit the finished() signal when they are done. Build
step implementors no longer have to deal with a QFutureInterface. For
steps whose implementation is inherently synchronous, the BuildStep base
class offers a runInThread() function.
Change-Id: If905c68b234c5a669f6e19f43142eaa57d594803
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/qbsprojectmanager/qbsinstallstep.h')
-rw-r--r-- | src/plugins/qbsprojectmanager/qbsinstallstep.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.h b/src/plugins/qbsprojectmanager/qbsinstallstep.h index ec91b5b837..6b5c62eb73 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.h +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.h @@ -45,16 +45,6 @@ public: explicit QbsInstallStep(ProjectExplorer::BuildStepList *bsl); ~QbsInstallStep() override; - bool init() override; - void run(QFutureInterface<bool> &fi) override; - - ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; - - void cancel() override; - - bool fromMap(const QVariantMap &map) override; - QVariantMap toMap() const override; - qbs::InstallOptions installOptions() const; QString installRoot() const; bool removeFirst() const; @@ -65,6 +55,13 @@ signals: void changed(); private: + bool init() override; + void doRun() override; + void doCancel() override; + ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; + bool fromMap(const QVariantMap &map) override; + QVariantMap toMap() const override; + const QbsBuildConfiguration *buildConfig() const; void installDone(bool success); void handleTaskStarted(const QString &desciption, int max); @@ -80,9 +77,9 @@ private: qbs::InstallOptions m_qbsInstallOptions; - QFutureInterface<bool> *m_fi = nullptr; qbs::InstallJob *m_job = nullptr; - int m_progressBase; + QString m_description; + int m_maxProgress; bool m_showCompilerOutput = true; ProjectExplorer::IOutputParser *m_parser = nullptr; |