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/cmakeprojectmanager/cmakebuildstep.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/plugins/cmakeprojectmanager/cmakebuildstep.cpp') diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index a72cefd38c..186500b03e 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -109,11 +109,6 @@ CMakeBuildConfiguration *CMakeBuildStep::cmakeBuildConfiguration() const return static_cast(buildConfiguration()); } -CMakeBuildConfiguration *CMakeBuildStep::targetsActiveBuildConfiguration() const -{ - return static_cast(target()->activeBuildConfiguration()); -} - CMakeRunConfiguration *CMakeBuildStep::targetsActiveRunConfiguration() const { return qobject_cast(target()->activeRunConfiguration()); @@ -154,8 +149,6 @@ bool CMakeBuildStep::init(QList &earlierSteps) { bool canInit = true; CMakeBuildConfiguration *bc = cmakeBuildConfiguration(); - if (!bc) - bc = targetsActiveBuildConfiguration(); if (!bc) { emit addTask(Task::buildConfigurationMissingTask()); canInit = false; @@ -241,8 +234,6 @@ void CMakeBuildStep::run(QFutureInterface &fi) { // Make sure CMake state was written to disk before trying to build: CMakeBuildConfiguration *bc = cmakeBuildConfiguration(); - if (!bc) - bc = targetsActiveBuildConfiguration(); QTC_ASSERT(bc, return); bool mustDelay = false; @@ -535,8 +526,6 @@ void CMakeBuildStepConfigWidget::selectedBuildTargetsChanged() void CMakeBuildStepConfigWidget::updateDetails() { BuildConfiguration *bc = m_buildStep->buildConfiguration(); - if (!bc) - bc = m_buildStep->targetsActiveBuildConfiguration(); if (!bc) { m_summaryText = tr("No build configuration found on this kit."); emit updateSummary(); -- cgit v1.2.3