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>
This commit is contained in:
Orgad Shaneh
2016-03-31 17:09:56 +03:00
committed by Orgad Shaneh
parent 1d0e1633c2
commit 3805512156
3 changed files with 13 additions and 3 deletions

View File

@@ -1352,6 +1352,15 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
return bc ? bc->displayName() : QString(); 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, expander->registerVariable(Constants::VAR_CURRENTBUILD_TYPE,
tr("The currently active build configuration's type."), tr("The currently active build configuration's type."),

View File

@@ -236,6 +236,7 @@ const char VAR_CURRENTKIT_FILESYSTEMNAME[] = "CurrentKit:FileSystemName";
const char VAR_CURRENTKIT_ID[] = "CurrentKit:Id"; const char VAR_CURRENTKIT_ID[] = "CurrentKit:Id";
const char VAR_CURRENTBUILD_NAME[] = "CurrentBuild:Name"; const char VAR_CURRENTBUILD_NAME[] = "CurrentBuild:Name";
const char VAR_CURRENTBUILD_TYPE[] = "CurrentBuild:Type"; 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_HOSTADDRESS[] = "CurrentDevice:HostAddress";
const char VAR_CURRENTDEVICE_SSHPORT[] = "CurrentDevice:SshPort"; const char VAR_CURRENTDEVICE_SSHPORT[] = "CurrentDevice:SshPort";
const char VAR_CURRENTDEVICE_USERNAME[] = "CurrentDevice:UserName"; const char VAR_CURRENTDEVICE_USERNAME[] = "CurrentDevice:UserName";

View File

@@ -256,9 +256,9 @@ void RunConfiguration::ctor()
BuildConfiguration *bc = target()->activeBuildConfiguration(); BuildConfiguration *bc = target()->activeBuildConfiguration();
return bc ? bc->macroExpander() : target()->macroExpander(); return bc ? bc->macroExpander() : target()->macroExpander();
}); });
expander->registerVariable("RunConfiguration:Name", expander->registerVariable(Constants::VAR_CURRENTRUN_NAME,
QCoreApplication::translate("ProjectExplorer", "Name of run configuration"), QCoreApplication::translate("ProjectExplorer", "The currently active run configuration's name."),
[this] { return displayName(); }); [this] { return displayName(); }, false);
} }
/*! /*!