forked from qt-creator/qt-creator
ProjectExplorer: Simplify use of AbstractProcessStep::init()
1. Systematically check for AbstractProcessStep::init() first in derived classes. 2. Use setupProcessParameters(processParameters()); by default in the base implementation. 3. Drop all re-implementations that are effectively the same. Change-Id: I0ae54dd4909b354672a63ee56d0b7c2ea0732494 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -187,6 +187,8 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, Utils::Id id) :
|
||||
|
||||
setLowPriority();
|
||||
|
||||
setCommandLineProvider([this] { return cmakeCommand(); });
|
||||
|
||||
setEnvironmentModifier([](Environment &env) {
|
||||
const QString ninjaProgressString = "[%f/%t "; // ninja: [33/100
|
||||
Environment::setupEnglishOutput(&env);
|
||||
@@ -219,6 +221,9 @@ bool CMakeBuildStep::fromMap(const QVariantMap &map)
|
||||
|
||||
bool CMakeBuildStep::init()
|
||||
{
|
||||
if (!AbstractProcessStep::init())
|
||||
return false;
|
||||
|
||||
BuildConfiguration *bc = buildConfiguration();
|
||||
QTC_ASSERT(bc, return false);
|
||||
|
||||
@@ -265,11 +270,7 @@ bool CMakeBuildStep::init()
|
||||
|
||||
setIgnoreReturnValue(m_buildTargets == QStringList(CMakeBuildStep::cleanTarget()));
|
||||
|
||||
ProcessParameters *pp = processParameters();
|
||||
setupProcessParameters(pp);
|
||||
pp->setCommandLine(cmakeCommand());
|
||||
|
||||
return AbstractProcessStep::init();
|
||||
return true;
|
||||
}
|
||||
|
||||
void CMakeBuildStep::setupOutputFormatter(Utils::OutputFormatter *formatter)
|
||||
|
||||
Reference in New Issue
Block a user