From f83347ec009e0565518d3c0e5c02627837f01ac6 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 31 Mar 2020 20:22:44 +0200 Subject: [PATCH] ProjectExplorer: Introduce an Targer::activeBuildKey() ... redirecting to activeRunConfiguration()->buildKey() This will allow the user code side to be moved closer to a setup that will allow to shift the build data stored in project nodes to the build system. Change-Id: Icdf03e77bf61ee03b3a16855ac67652c205402fa Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/target.cpp | 9 +++++++++ src/plugins/projectexplorer/target.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp index b1ff917bf75..e46f259f8a3 100644 --- a/src/plugins/projectexplorer/target.cpp +++ b/src/plugins/projectexplorer/target.cpp @@ -238,6 +238,15 @@ BuildTargetInfo Target::buildTarget(const QString &buildKey) const return buildSystem()->buildTarget(buildKey); } +QString Target::activeBuildKey() const +{ + // Should not happen. If it does, return a buildKey that wont be found in + // the project tree, so that the project()->findNodeForBuildKey(buildKey) + // returns null. + QTC_ASSERT(d->m_activeRunConfiguration, return QString(QChar(0))); + return d->m_activeRunConfiguration->buildKey(); +} + Core::Id Target::id() const { return d->m_kit->id(); diff --git a/src/plugins/projectexplorer/target.h b/src/plugins/projectexplorer/target.h index 34d48e78e8a..26be1fb988c 100644 --- a/src/plugins/projectexplorer/target.h +++ b/src/plugins/projectexplorer/target.h @@ -123,6 +123,8 @@ public: DeploymentData buildSystemDeploymentData() const; BuildTargetInfo buildTarget(const QString &buildKey) const; + QString activeBuildKey() const; // Build key of active run configuaration + signals: void targetEnabled(bool); void iconChanged();