diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2016-03-31 17:09:56 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2016-04-01 08:35:59 +0000 |
commit | 380551215668743be9586798b50f9b9bceccd737 (patch) | |
tree | 7b2bfbe11087ff81db289e74974151f7fdb0c963 | |
parent | 1d0e1633c23d54764e02b8ecf13351ab05e36bdd (diff) | |
download | qt-creator-380551215668743be9586798b50f9b9bceccd737.tar.gz |
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 <tobias.hunger@theqtcompany.com>
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.cpp | 9 | ||||
-rw-r--r-- | src/plugins/projectexplorer/projectexplorerconstants.h | 1 | ||||
-rw-r--r-- | 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 6e1bfe6a2c..0448ad2e15 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 88e6c4d3a7..f0e866916e 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 2fc8554d56..c83c064de5 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); } /*! |