diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index e5fd014e8d5..575279a8999 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1328,6 +1328,19 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er 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()) + return rc->runnable().as().executable; + } + } + return QString(); + }, + true); + expander->registerVariable(Constants::VAR_CURRENTBUILD_TYPE, tr("The currently active build configuration's type."), [&]() -> QString { diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h index 7be8911395e..e916b648e78 100644 --- a/src/plugins/projectexplorer/projectexplorerconstants.h +++ b/src/plugins/projectexplorer/projectexplorerconstants.h @@ -239,6 +239,7 @@ 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_CURRENTRUN_EXECUTABLE_PREFIX[] = "CurrentRun:Executable"; const char VAR_CURRENTDEVICE_HOSTADDRESS[] = "CurrentDevice:HostAddress"; const char VAR_CURRENTDEVICE_SSHPORT[] = "CurrentDevice:SshPort"; const char VAR_CURRENTDEVICE_USERNAME[] = "CurrentDevice:UserName";