From e63a6744ba4d13e8bf9f8b600f8298a2baeb9260 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 17 Feb 2020 09:20:42 +0100 Subject: [PATCH] ProjectExplorer: Make some noise in BuildStep::buildSystem ... when it is potentially diverting to a wrong build configuration. Change-Id: Ib2b11268cf64e9a969e7636cb2d70f1843f5c7a4 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/buildstep.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp index ba0bfa221a3..930b7a6b3fa 100644 --- a/src/plugins/projectexplorer/buildstep.cpp +++ b/src/plugins/projectexplorer/buildstep.cpp @@ -186,6 +186,13 @@ BuildConfiguration *BuildStep::buildConfiguration() const auto config = qobject_cast(parent()->parent()); if (config) return config; + + // This situation should be avoided, as the step returned below is almost + // always not the right one, but the fallback is best we can do. + // A potential currently still valid path is accessing a build configuration + // from a BuildStep in a DeployConfiguration. Let's hunt those down and + // replace with explicit code there. + QTC_CHECK(false); // step is not part of a build configuration, use active build configuration of step's target return target()->activeBuildConfiguration(); } @@ -195,6 +202,8 @@ DeployConfiguration *BuildStep::deployConfiguration() const auto config = qobject_cast(parent()->parent()); if (config) return config; + // See comment in buildConfiguration() + QTC_CHECK(false); // step is not part of a deploy configuration, use active deploy configuration of step's target return target()->activeDeployConfiguration(); }