ProjectExplorer: Remove redundant MakeStep::{is,set}Clean()

This was only used for setIgnoreReturnValue(), which can be done
directly and also does not need to be stored in the settings.

Change-Id: I7419efe66d164b223463e19c3daf2350b4a2bae4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-08-19 09:00:58 +02:00
parent 6c785c05ab
commit 070e0932c9
6 changed files with 4 additions and 31 deletions

View File

@@ -50,7 +50,7 @@ MakeStep::MakeStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id)
setAvailableBuildTargets({"all", "clean"}); setAvailableBuildTargets({"all", "clean"});
if (bsl->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) { if (bsl->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) {
setBuildTarget("clean", true); setBuildTarget("clean", true);
setClean(true); setIgnoreReturnValue(true);
} else { } else {
setBuildTarget("all", true); setBuildTarget("all", true);
} }

View File

@@ -47,7 +47,7 @@ GenericMakeStep::GenericMakeStep(BuildStepList *parent, Utils::Id id)
setBuildTarget("all"); setBuildTarget("all");
} else if (parent->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) { } else if (parent->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) {
setBuildTarget("clean"); setBuildTarget("clean");
setClean(true); setIgnoreReturnValue(true);
} }
setAvailableBuildTargets({"all", "clean"}); setAvailableBuildTargets({"all", "clean"});
} }

View File

@@ -143,8 +143,6 @@ bool AbstractProcessStep::ignoreReturnValue() const
/*! /*!
If \a ignoreReturnValue is set to true, then the abstractprocess step will If \a ignoreReturnValue is set to true, then the abstractprocess step will
return success even if the return value indicates otherwise. return success even if the return value indicates otherwise.
Should be called from init.
*/ */
void AbstractProcessStep::setIgnoreReturnValue(bool b) void AbstractProcessStep::setIgnoreReturnValue(bool b)

View File

@@ -162,9 +162,6 @@ MakeStep::MakeStep(BuildStepList *parent, Utils::Id id)
.arg(text) + "</p></body></html>"); .arg(text) + "</p></body></html>");
m_nonOverrideWarning->setIconType(InfoLabel::Warning); m_nonOverrideWarning->setIconType(InfoLabel::Warning);
m_cleanAspect = addAspect<BoolAspect>();
m_cleanAspect->setSettingsKey(id.withSuffix(CLEAN_SUFFIX).toString());
m_buildTargetsAspect = addAspect<StringListAspect>(); m_buildTargetsAspect = addAspect<StringListAspect>();
m_buildTargetsAspect->setSettingsKey(id.withSuffix(BUILD_TARGETS_SUFFIX).toString()); m_buildTargetsAspect->setSettingsKey(id.withSuffix(BUILD_TARGETS_SUFFIX).toString());
@@ -207,11 +204,6 @@ bool MakeStep::init()
setupProcessParameters(pp); setupProcessParameters(pp);
pp->setCommandLine(make); pp->setCommandLine(make);
// If we are cleaning, then make can fail with an error code, but that doesn't mean
// we should stop the clean queue
// That is mostly so that rebuild works on an already clean project
setIgnoreReturnValue(isClean());
return AbstractProcessStep::init(); return AbstractProcessStep::init();
} }
@@ -223,16 +215,6 @@ void MakeStep::setupOutputFormatter(OutputFormatter *formatter)
AbstractProcessStep::setupOutputFormatter(formatter); AbstractProcessStep::setupOutputFormatter(formatter);
} }
void MakeStep::setClean(bool clean)
{
m_cleanAspect->setValue(clean);
}
bool MakeStep::isClean() const
{
return m_cleanAspect->value();
}
QString MakeStep::defaultDisplayName() QString MakeStep::defaultDisplayName()
{ {
return tr("Make"); return tr("Make");

View File

@@ -69,9 +69,6 @@ public:
Utils::FilePath makeExecutable() const; Utils::FilePath makeExecutable() const;
Utils::CommandLine effectiveMakeCommand(MakeCommandType type) const; Utils::CommandLine effectiveMakeCommand(MakeCommandType type) const;
void setClean(bool clean);
bool isClean() const;
static QString defaultDisplayName(); static QString defaultDisplayName();
Utils::FilePath defaultMakeCommand() const; Utils::FilePath defaultMakeCommand() const;

View File

@@ -56,7 +56,7 @@ QmakeMakeStep::QmakeMakeStep(BuildStepList *bsl, Utils::Id id)
: MakeStep(bsl, id) : MakeStep(bsl, id)
{ {
if (bsl->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) { if (bsl->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) {
setClean(true); setIgnoreReturnValue(true);
setUserArguments("clean"); setUserArguments("clean");
} }
supportDisablingForSubdirs(); supportDisablingForSubdirs();
@@ -89,11 +89,6 @@ bool QmakeMakeStep::init()
workingDirectory = bc->buildDirectory(); workingDirectory = bc->buildDirectory();
pp->setWorkingDirectory(workingDirectory); pp->setWorkingDirectory(workingDirectory);
// If we are cleaning, then make can fail with a error code, but that doesn't mean
// we should stop the clean queue
// That is mostly so that rebuild works on a already clean project
setIgnoreReturnValue(isClean());
Utils::CommandLine makeCmd(makeExecutable); Utils::CommandLine makeCmd(makeExecutable);
QmakeProjectManager::QmakeProFileNode *subProFile = bc->subNodeBuild(); QmakeProjectManager::QmakeProFileNode *subProFile = bc->subNodeBuild();
@@ -176,6 +171,7 @@ bool QmakeMakeStep::init()
qmakeStep->setForced(true); qmakeStep->setForced(true);
} }
// Note: This skips the Makestep::init() level.
return AbstractProcessStep::init(); return AbstractProcessStep::init();
} }