ProjectExplorer: Replace ProjectConfiguration::m_macroExpander

... by MacroExpanders in Build and RunConfiguration. Deploy didn't
use its own, BuildStep always composed an empty expander with
the BuildConfiguration's, uses now the BuildConfiguration's expander
directly.

Change-Id: I9de51bfc32aeb3d73f4974175e42a37807e49ac1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2020-02-18 14:44:58 +01:00
parent e63a6744ba
commit a68aee95a1
13 changed files with 44 additions and 37 deletions

View File

@@ -150,17 +150,16 @@ Target::Target(Project *project, Kit *k, _constructor_tag) :
connect(km, &KitManager::kitUpdated, this, &Target::handleKitUpdates);
connect(km, &KitManager::kitRemoved, this, &Target::handleKitRemoval);
Utils::MacroExpander *expander = macroExpander();
expander->setDisplayName(tr("Target Settings"));
expander->setAccumulating(true);
d->m_macroExpander.setDisplayName(tr("Target Settings"));
d->m_macroExpander.setAccumulating(true);
expander->registerSubProvider([this] { return kit()->macroExpander(); });
d->m_macroExpander.registerSubProvider([this] { return kit()->macroExpander(); });
expander->registerVariable("sourceDir", tr("Source directory"),
d->m_macroExpander.registerVariable("sourceDir", tr("Source directory"),
[project] { return project->projectDirectory().toUserOutput(); });
// Legacy support.
expander->registerVariable(Constants::VAR_CURRENTPROJECT_NAME,
d->m_macroExpander.registerVariable(Constants::VAR_CURRENTPROJECT_NAME,
QCoreApplication::translate("ProjectExplorer", "Name of current project"),
[project] { return project->displayName(); },
false);