diff --git a/src/plugins/projectexplorer/environmentaspectwidget.cpp b/src/plugins/projectexplorer/environmentaspectwidget.cpp index 4836af785123c9c38878a6cd9eda7428eda4bf40..79ff5d61273709c5e7f065f55899b93deca941b4 100644 --- a/src/plugins/projectexplorer/environmentaspectwidget.cpp +++ b/src/plugins/projectexplorer/environmentaspectwidget.cpp @@ -97,6 +97,8 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect, QWid connect(m_aspect, SIGNAL(baseEnvironmentChanged()), this, SLOT(changeBaseEnvironment())); connect(m_aspect, SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)), this, SLOT(changeUserChanges(QList<Utils::EnvironmentItem>))); + connect(m_aspect, SIGNAL(environmentChanged()), + this, SLOT(environmentChanged())); } QString EnvironmentAspectWidget::displayName() const @@ -118,6 +120,7 @@ void EnvironmentAspectWidget::baseEnvironmentSelected(int idx) { m_ignoreChange = true; m_aspect->setBaseEnvironmentBase(m_baseEnvironmentComboBox->itemData(idx).toInt()); + m_environmentWidget->setBaseEnvironment(m_aspect->baseEnvironment()); m_ignoreChange = false; } @@ -132,6 +135,7 @@ void EnvironmentAspectWidget::changeBaseEnvironment() m_baseEnvironmentComboBox->setCurrentIndex(i); } m_environmentWidget->setBaseEnvironmentText(m_aspect->baseEnvironmentDisplayName(base)); + m_environmentWidget->setBaseEnvironment(m_aspect->baseEnvironment()); } void EnvironmentAspectWidget::userChangesEdited() @@ -148,4 +152,11 @@ void EnvironmentAspectWidget::changeUserChanges(QList<Utils::EnvironmentItem> ch m_environmentWidget->setUserChanges(changes); } +void EnvironmentAspectWidget::environmentChanged() +{ + if (m_ignoreChange) + return; + m_environmentWidget->setBaseEnvironment(m_aspect->baseEnvironment()); +} + } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/environmentaspectwidget.h b/src/plugins/projectexplorer/environmentaspectwidget.h index 2093eac8a78a0aad2072c4688fba819e43de2232..465b802640a06997bf0d9e11034a355ec32dc10d 100644 --- a/src/plugins/projectexplorer/environmentaspectwidget.h +++ b/src/plugins/projectexplorer/environmentaspectwidget.h @@ -67,6 +67,7 @@ private slots: void changeBaseEnvironment(); void userChangesEdited(); void changeUserChanges(QList<Utils::EnvironmentItem> changes); + void environmentChanged(); private: EnvironmentAspect *m_aspect; diff --git a/src/plugins/projectexplorer/localenvironmentaspect.cpp b/src/plugins/projectexplorer/localenvironmentaspect.cpp index 8e84bc3b4704ec01c4f27f41f097ca3b91f64f5e..1ec0d7f48952dd6e1ada0e42b6b95406cb540e4e 100644 --- a/src/plugins/projectexplorer/localenvironmentaspect.cpp +++ b/src/plugins/projectexplorer/localenvironmentaspect.cpp @@ -84,10 +84,8 @@ Utils::Environment LocalEnvironmentAspect::baseEnvironment() const void LocalEnvironmentAspect::buildEnvironmentHasChanged() { - if (baseEnvironmentBase() == static_cast<int>(BuildEnvironmentBase)) { - emit baseEnvironmentChanged(); + if (baseEnvironmentBase() == static_cast<int>(BuildEnvironmentBase)) emit environmentChanged(); - } } LocalEnvironmentAspect::LocalEnvironmentAspect(RunConfiguration *rc) : diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp index 22b9ca979108ee997035731edf730e386b54e4ca..70b3da4884506ecf9b87f30ef294c04ea0e400eb 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp @@ -87,11 +87,8 @@ void RemoteLinuxEnvironmentAspect::setRemoteEnvironment(const Utils::Environment { if (env != m_remoteEnvironment) { m_remoteEnvironment = env; - emit remoteEnvironmentChanged(); - if (baseEnvironmentBase() == static_cast<int>(RemoteBaseEnvironment)) { - emit baseEnvironmentChanged(); + if (baseEnvironmentBase() == static_cast<int>(RemoteBaseEnvironment)) emit environmentChanged(); - } } } diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h index 44313727314af955bd2be28bc3f650d40dad76b4..c17703436005ad32c11a3fc9d8d15c9245b05f24 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.h +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.h @@ -60,9 +60,6 @@ public: QString userEnvironmentChangesAsString() const; -signals: - void remoteEnvironmentChanged(); - private: enum BaseEnvironmentBase { CleanBaseEnvironment = 0,