ProjectExplorer: Expose working directory to macro expanders

Change-Id: I02ab3d4c4d850bc3c50186d4458b6a87d50a3926
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2019-05-14 17:19:04 +02:00
parent fd1ca5e06f
commit 348a7dadac
2 changed files with 9 additions and 0 deletions

View File

@@ -186,6 +186,14 @@ RunConfiguration::RunConfiguration(Target *target, Core::Id id)
const auto envAspect = aspect<EnvironmentAspect>();
return envAspect ? envAspect->environment().value(var) : QString();
});
expander->registerVariable(Constants::VAR_CURRENTRUN_WORKINGDIR,
tr("The currently active run configuration's working directory"),
[this, expander] {
const auto wdAspect = aspect<WorkingDirectoryAspect>();
return wdAspect ? wdAspect->workingDirectory(expander).toString() : QString();
});
expander->registerVariable(Constants::VAR_CURRENTRUN_NAME,
QCoreApplication::translate("ProjectExplorer", "The currently active run configuration's name."),
[this] { return displayName(); }, false);