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();