Add macros for current run configurations executable

Accessible by CurrentRun:Runnable:FilePath etc.

Task-number: QTCREATORBUG-12201
Change-Id: Ia8cde111507d8fd755d43f935fd2d319dfb73a67
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Andre Hartmann
2016-12-15 10:27:24 +01:00
committed by André Hartmann
parent 347db259f8
commit 1bce506552
2 changed files with 14 additions and 0 deletions

View File

@@ -1328,6 +1328,19 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
return QString(); return QString();
}); });
expander->registerFileVariables(Constants::VAR_CURRENTRUN_EXECUTABLE_PREFIX,
tr("The currently active run configuration's executable (if applicable)"),
[this]() -> QString {
if (Target *target = activeTarget()) {
if (RunConfiguration *rc = target->activeRunConfiguration()) {
if (rc->runnable().is<StandardRunnable>())
return rc->runnable().as<StandardRunnable>().executable;
}
}
return QString();
},
true);
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."),
[&]() -> QString { [&]() -> QString {

View File

@@ -239,6 +239,7 @@ 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_CURRENTRUN_NAME[] = "CurrentRun:Name";
const char VAR_CURRENTRUN_EXECUTABLE_PREFIX[] = "CurrentRun:Executable";
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";