BuildStep: Remove finished() signal and use FutureInterface to report

Remove the finished() signal that is (sometimes) used to report that
a buildstep is done and use the FutureInterface for that purpose
consistently.

Change-Id: Ibe5520b562b91f1a7f4fc73ee898b33b930029ec
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2016-04-20 12:49:25 +02:00
parent f421176f22
commit 2e5102f45e
25 changed files with 71 additions and 113 deletions

View File

@@ -187,8 +187,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
emit addOutput(tr("Could not create directory \"%1\"")
.arg(QDir::toNativeSeparators(wd.absolutePath())),
BuildStep::ErrorMessageOutput);
fi.reportResult(false);
emit finished();
reportRunResult(fi, false);
return;
}
}
@@ -196,8 +195,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
QString effectiveCommand = m_param.effectiveCommand();
if (!QFileInfo::exists(effectiveCommand)) {
processStartupFailed();
fi.reportResult(false);
emit finished();
reportRunResult(fi, false);
return;
}
@@ -221,8 +219,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
processStartupFailed();
delete m_process;
m_process = nullptr;
fi.reportResult(false);
emit finished();
reportRunResult(fi, false);
return;
}
processStarted();
@@ -237,7 +234,7 @@ void AbstractProcessStep::cleanUp()
{
// The process has finished, leftover data is read in processFinished
processFinished(m_process->exitCode(), m_process->exitStatus());
bool returnValue = processSucceeded(m_process->exitCode(), m_process->exitStatus()) || m_ignoreReturnValue;
const bool returnValue = processSucceeded(m_process->exitCode(), m_process->exitStatus()) || m_ignoreReturnValue;
// Clean up output parsers
if (m_outputParserChain) {
@@ -245,12 +242,13 @@ void AbstractProcessStep::cleanUp()
m_outputParserChain = nullptr;
}
// Clean up process
delete m_process;
m_process = nullptr;
m_futureInterface->reportResult(returnValue);
m_futureInterface = nullptr;
emit finished();
// Report result
reportRunResult(*m_futureInterface, returnValue);
m_futureInterface = nullptr;
}
/*!