forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -95,7 +95,7 @@ bool AndroidPackageInstallationStep::init()
|
||||
return AbstractProcessStep::init();
|
||||
}
|
||||
|
||||
void AndroidPackageInstallationStep::run(QFutureInterface<bool> &fi)
|
||||
void AndroidPackageInstallationStep::doRun()
|
||||
{
|
||||
QString error;
|
||||
foreach (const QString &dir, m_androidDirsToClean) {
|
||||
@@ -104,12 +104,12 @@ void AndroidPackageInstallationStep::run(QFutureInterface<bool> &fi)
|
||||
emit addOutput(tr("Removing directory %1").arg(dir), OutputFormat::NormalMessage);
|
||||
if (!FileUtils::removeRecursively(androidDir, &error)) {
|
||||
emit addOutput(error, OutputFormat::Stderr);
|
||||
reportRunResult(fi, false);
|
||||
emit finished(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
AbstractProcessStep::run(fi);
|
||||
AbstractProcessStep::doRun();
|
||||
}
|
||||
|
||||
BuildStepConfigWidget *AndroidPackageInstallationStep::createConfigWidget()
|
||||
|
Reference in New Issue
Block a user