diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2017-07-29 23:34:56 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2017-08-02 11:19:28 +0000 |
commit | e52ebbf217499e50a00ec35095aaf0f606416491 (patch) | |
tree | 89044e062e2dcc6c9c7aa799192f1dd03bf410ad /src/plugins/projectexplorer/localenvironmentaspect.cpp | |
parent | 34456aa906434b2c90ff179b11ba90dc5a273bd6 (diff) | |
download | qt-creator-e52ebbf217499e50a00ec35095aaf0f606416491.tar.gz |
ProjectExplorer: Add subscribeSignal method to targets and projects
Add a subscribeSignal method to targets and projects that will make
sure all signals of all project configurations added during the lifetime
of the project/target will get connected (if the type matches).
Use this to connect to some signal in all BuildConfigurations of
a project and get rid of code that keeps connecting to the current
build configuration.
Use Project::buildEnvironmentChanged as an example and convert its
usages.
Change-Id: I689bcebac4b191bf3f8a18765bf18eaac371c5fe
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/localenvironmentaspect.cpp')
-rw-r--r-- | src/plugins/projectexplorer/localenvironmentaspect.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/localenvironmentaspect.cpp b/src/plugins/projectexplorer/localenvironmentaspect.cpp index edc9e8a761..9d7cd8dcdc 100644 --- a/src/plugins/projectexplorer/localenvironmentaspect.cpp +++ b/src/plugins/projectexplorer/localenvironmentaspect.cpp @@ -88,7 +88,9 @@ LocalEnvironmentAspect::LocalEnvironmentAspect(RunConfiguration *parent, const BaseEnvironmentModifier &modifier) : EnvironmentAspect(parent), m_baseEnvironmentModifier(modifier) { - connect(parent->target(), &Target::environmentChanged, + parent->target()->subscribeSignal(&BuildConfiguration::environmentChanged, + this, &LocalEnvironmentAspect::buildEnvironmentHasChanged); + connect(parent->target(), &Target::activeBuildConfigurationChanged, this, &LocalEnvironmentAspect::buildEnvironmentHasChanged); } |