Centralize retrieving the "parent" build configuration

If a step is part of a build configuration, that is used, but many steps
can be used as part of a deploy configuration.
In that case the active build configuration of the step's target must be
used, and that logic was duplicated many times.
Instead, let BuildStep::buildConfiguration take care of that logic. For
steps that are not offered for deploy configurations there is no
semantic difference, and for the others this removes code duplication.

Change-Id: I02f3bb50226590092cedcec02fce6fde9c7c6e63
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Eike Ziller
2018-05-17 10:26:10 +02:00
parent d2a9e1b892
commit 58bd043e27
16 changed files with 21 additions and 56 deletions

View File

@@ -121,8 +121,6 @@ QString MakeStep::effectiveMakeCommand() const
if (!m_makeCommand.isEmpty())
return m_makeCommand;
BuildConfiguration *bc = buildConfiguration();
if (!bc)
bc = target()->activeBuildConfiguration();
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
if (bc && tc)
return tc->makeCommand(bc->environment());
@@ -245,8 +243,6 @@ void MakeStepConfigWidget::updateDetails()
ToolChain *tc
= ToolChainKitInformation::toolChain(m_makeStep->target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
BuildConfiguration *bc = m_makeStep->buildConfiguration();
if (!bc)
bc = m_makeStep->target()->activeBuildConfiguration();
const QString make = tc && bc ? tc->makeCommand(bc->environment()) : QString();
if (make.isEmpty())