forked from qt-creator/qt-creator
ProjectExplorer: Expose working directory to macro expanders
Change-Id: I02ab3d4c4d850bc3c50186d4458b6a87d50a3926 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user