diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-05-17 10:26:10 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-05-22 12:18:36 +0000 |
commit | 58bd043e2722e7670008fb180faf982294221d4c (patch) | |
tree | b062e9e013ad02c0b769695d64d4655784bae7f5 /src/plugins/ios | |
parent | d2a9e1b892456b0500bdc79ca749d2bdf02afab5 (diff) | |
download | qt-creator-58bd043e2722e7670008fb180faf982294221d4c.tar.gz |
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>
Diffstat (limited to 'src/plugins/ios')
-rw-r--r-- | src/plugins/ios/iosbuildstep.cpp | 10 | ||||
-rw-r--r-- | src/plugins/ios/iosdsymbuildstep.cpp | 4 |
2 files changed, 3 insertions, 11 deletions
diff --git a/src/plugins/ios/iosbuildstep.cpp b/src/plugins/ios/iosbuildstep.cpp index 61fb670c90..3c04cc7080 100644 --- a/src/plugins/ios/iosbuildstep.cpp +++ b/src/plugins/ios/iosbuildstep.cpp @@ -73,8 +73,6 @@ bool IosBuildStep::init(QList<const BuildStep *> &earlierSteps) { BuildConfiguration *bc = buildConfiguration(); if (!bc) - bc = target()->activeBuildConfiguration(); - if (!bc) emit addTask(Task::buildConfigurationMissingTask()); ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID); @@ -140,7 +138,7 @@ QStringList IosBuildStep::defaultArguments() const QStringList res; Kit *kit = target()->kit(); ToolChain *tc = ToolChainKitInformation::toolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID); - switch (target()->activeBuildConfiguration()->buildType()) { + switch (buildConfiguration()->buildType()) { case BuildConfiguration::Debug : res << "-configuration" << "Debug"; break; @@ -152,7 +150,7 @@ QStringList IosBuildStep::defaultArguments() const break; default: qCWarning(iosLog) << "IosBuildStep had an unknown buildType " - << target()->activeBuildConfiguration()->buildType(); + << buildConfiguration()->buildType(); } if (tc->typeId() == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID || tc->typeId() == ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID) { @@ -161,7 +159,7 @@ QStringList IosBuildStep::defaultArguments() const } if (!SysRootKitInformation::sysRoot(kit).isEmpty()) res << "-sdk" << SysRootKitInformation::sysRoot(kit).toString(); - res << "SYMROOT=" + target()->activeBuildConfiguration()->buildDirectory().toString(); + res << "SYMROOT=" + buildConfiguration()->buildDirectory().toString(); return res; } @@ -257,8 +255,6 @@ QString IosBuildStepConfigWidget::displayName() const void IosBuildStepConfigWidget::updateDetails() { BuildConfiguration *bc = m_buildStep->buildConfiguration(); - if (!bc) - bc = m_buildStep->target()->activeBuildConfiguration(); ProcessParameters param; param.setMacroExpander(bc->macroExpander()); diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index 2cf4834bc6..3fc3c090dc 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -64,8 +64,6 @@ IosDsymBuildStep::IosDsymBuildStep(BuildStepList *parent) : bool IosDsymBuildStep::init(QList<const BuildStep *> &earlierSteps) { BuildConfiguration *bc = buildConfiguration(); - if (!bc) - bc = target()->activeBuildConfiguration(); ProcessParameters *pp = processParameters(); pp->setMacroExpander(bc->macroExpander()); @@ -277,8 +275,6 @@ QString IosDsymBuildStepConfigWidget::displayName() const void IosDsymBuildStepConfigWidget::updateDetails() { BuildConfiguration *bc = m_buildStep->buildConfiguration(); - if (!bc) - bc = m_buildStep->target()->activeBuildConfiguration(); ProcessParameters param; param.setMacroExpander(bc->macroExpander()); |