From 58bd043e2722e7670008fb180faf982294221d4c Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 17 May 2018 10:26:10 +0200 Subject: 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 --- src/plugins/qbsprojectmanager/qbsbuildstep.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/plugins/qbsprojectmanager/qbsbuildstep.cpp') diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index c01db641e3..a8aa93f060 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -149,8 +149,6 @@ bool QbsBuildStep::init(QList &earlierSteps) return false; QbsBuildConfiguration *bc = static_cast(buildConfiguration()); - if (!bc) - bc = static_cast(target()->activeBuildConfiguration()); if (!bc) return false; @@ -549,7 +547,7 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) : this, &QbsBuildStepConfigWidget::updateState); step->target()->subscribeSignal(&ProjectExplorer::BuildConfiguration::buildDirectoryChanged, this, [this]() { - if (m_step->target()->activeBuildConfiguration() == sender()) + if (m_step->buildConfiguration() == sender()) updateState(); }); -- cgit v1.2.3