ProjectExplorer: Make some noise in BuildStep::buildSystem

... when it is potentially diverting to a wrong build configuration.

Change-Id: Ib2b11268cf64e9a969e7636cb2d70f1843f5c7a4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-02-17 09:20:42 +01:00
parent 15eccee798
commit e63a6744ba

View File

@@ -186,6 +186,13 @@ BuildConfiguration *BuildStep::buildConfiguration() const
auto config = qobject_cast<BuildConfiguration *>(parent()->parent()); auto config = qobject_cast<BuildConfiguration *>(parent()->parent());
if (config) if (config)
return 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 // step is not part of a build configuration, use active build configuration of step's target
return target()->activeBuildConfiguration(); return target()->activeBuildConfiguration();
} }
@@ -195,6 +202,8 @@ DeployConfiguration *BuildStep::deployConfiguration() const
auto config = qobject_cast<DeployConfiguration *>(parent()->parent()); auto config = qobject_cast<DeployConfiguration *>(parent()->parent());
if (config) if (config)
return 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 // step is not part of a deploy configuration, use active deploy configuration of step's target
return target()->activeDeployConfiguration(); return target()->activeDeployConfiguration();
} }