ProjectExplorer: Trigger environment evaluation on current project change

This makes e.g. %{CurrentProject:VcsTopLevelPath} in the kit's
environment much more useful.

Task-number: QTCREATORBUG-20752
Change-Id: I4bf49e61a7a7281a6c9bf039a1d9118b6e4060ef
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Tobias Hunger
2018-07-12 12:33:53 +02:00
parent a94fcbd1e7
commit e20075f8cf

View File

@@ -79,6 +79,9 @@ BuildConfiguration::BuildConfiguration(Target *target, Core::Id id)
this, &BuildConfiguration::updateCacheAndEmitEnvironmentChanged);
connect(this, &BuildConfiguration::environmentChanged,
this, &BuildConfiguration::emitBuildDirectoryChanged);
// Many macroexpanders are based on the current project, so they may change the environment:
connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged,
this, &BuildConfiguration::updateCacheAndEmitEnvironmentChanged);
}
Utils::FileName BuildConfiguration::buildDirectory() const