ProjectExplorer: Make WorkingDirectoryAspect less dependent on runconfig

This was one of the genuine users of the run config pointer in the
aspect base class. Instead of using that stored pointer to retrieve
the relevant environment aspect pointer later, pass and store this
env aspect pointer at construction time.

Change-Id: Icbdeb9ad0fe341e4003fb544c542064801aa170f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
hjk
2018-09-10 12:41:51 +02:00
parent a865fa513b
commit 5bc0b6ce33
8 changed files with 28 additions and 19 deletions

View File

@@ -53,10 +53,11 @@ CMakeRunConfiguration::CMakeRunConfiguration(Target *target, Core::Id id)
if (qt)
env.prependOrSetPath(qt->qmakeProperty("QT_INSTALL_BINS"));
};
addAspect<LocalEnvironmentAspect>(cmakeRunEnvironmentModifier);
auto envAspect = addAspect<LocalEnvironmentAspect>(cmakeRunEnvironmentModifier);
addAspect<ExecutableAspect>();
addAspect<ArgumentsAspect>();
addAspect<WorkingDirectoryAspect>();
addAspect<WorkingDirectoryAspect>(envAspect);
addAspect<TerminalAspect>();
connect(target->project(), &Project::parsingFinished,