From 380551215668743be9586798b50f9b9bceccd737 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 31 Mar 2016 17:09:56 +0300 Subject: [PATCH] ProjectExplorer: Rename RunConfiguration:Name -> CurrentRun:Name Similar variables don't contain "Configuration" in their names. For example: CurrentBuild:Name. + make it available globally. Change-Id: Ie094e2f7afc449d678cf0afec1548350f03ead77 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/projectexplorer.cpp | 9 +++++++++ src/plugins/projectexplorer/projectexplorerconstants.h | 1 + src/plugins/projectexplorer/runconfiguration.cpp | 6 +++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 6e1bfe6a2c1..0448ad2e151 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1352,6 +1352,15 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er return bc ? bc->displayName() : QString(); }); + expander->registerVariable(Constants::VAR_CURRENTRUN_NAME, + tr("The currently active run configuration's name."), + [this]() -> QString { + if (Target *target = activeTarget()) { + if (RunConfiguration *rc = target->activeRunConfiguration()) + return rc->displayName(); + } + return QString(); + }); expander->registerVariable(Constants::VAR_CURRENTBUILD_TYPE, tr("The currently active build configuration's type."), diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index 88e6c4d3a7e..f0e866916ed 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -236,6 +236,7 @@ const char VAR_CURRENTKIT_FILESYSTEMNAME[] = "CurrentKit:FileSystemName"; const char VAR_CURRENTKIT_ID[] = "CurrentKit:Id"; const char VAR_CURRENTBUILD_NAME[] = "CurrentBuild:Name"; const char VAR_CURRENTBUILD_TYPE[] = "CurrentBuild:Type"; +const char VAR_CURRENTRUN_NAME[] = "CurrentRun:Name"; const char VAR_CURRENTDEVICE_HOSTADDRESS[] = "CurrentDevice:HostAddress"; const char VAR_CURRENTDEVICE_SSHPORT[] = "CurrentDevice:SshPort"; const char VAR_CURRENTDEVICE_USERNAME[] = "CurrentDevice:UserName"; diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 2fc8554d56c..c83c064de52 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -256,9 +256,9 @@ void RunConfiguration::ctor() BuildConfiguration *bc = target()->activeBuildConfiguration(); return bc ? bc->macroExpander() : target()->macroExpander(); }); - expander->registerVariable("RunConfiguration:Name", - QCoreApplication::translate("ProjectExplorer", "Name of run configuration"), - [this] { return displayName(); }); + expander->registerVariable(Constants::VAR_CURRENTRUN_NAME, + QCoreApplication::translate("ProjectExplorer", "The currently active run configuration's name."), + [this] { return displayName(); }, false); } /*!