forked from qt-creator/qt-creator
Set up hierarchy of ProjectConfiguration macro expanders.
BuildConfiguration asks Target, Deploy and Run ask either activeBuild, or Target. Change-Id: I3845cfbd16de7b85268d83b5324865ff24482152 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -140,27 +140,20 @@ Target::Target(Project *project, Kit *k) :
|
||||
this, SLOT(handleKitRemoval(ProjectExplorer::Kit*)));
|
||||
|
||||
Utils::MacroExpander *expander = macroExpander();
|
||||
expander->setDisplayName(tr("Target Settings"));
|
||||
expander->setAccumulating(true);
|
||||
|
||||
expander->registerSubProvider([this] { return kit()->macroExpander(); });
|
||||
|
||||
expander->registerVariable("sourceDir", tr("Source directory"),
|
||||
[project] { return project->projectDirectory().toUserOutput(); });
|
||||
|
||||
// Legacy support.
|
||||
expander->registerVariable(Constants::VAR_CURRENTPROJECT_NAME,
|
||||
QCoreApplication::translate("ProjectExplorer", "Name of current project"),
|
||||
[project] { return project->displayName(); },
|
||||
false);
|
||||
|
||||
expander->registerVariable(Constants::VAR_CURRENTBUILD_NAME,
|
||||
QCoreApplication::translate("ProjectExplorer", "Name of current build"),
|
||||
[this] { return activeBuildConfiguration() ? activeBuildConfiguration()->displayName() : QString(); },
|
||||
false);
|
||||
|
||||
expander->registerVariable("sourceDir", tr("Source directory"),
|
||||
[project] { return project->projectDirectory().toUserOutput(); });
|
||||
|
||||
expander->registerVariable("buildDir", tr("Build directory"),
|
||||
[this] { return activeBuildConfiguration()
|
||||
? activeBuildConfiguration()->buildDirectory().toUserOutput()
|
||||
: QString() ; });
|
||||
}
|
||||
|
||||
Target::~Target()
|
||||
|
||||
Reference in New Issue
Block a user