Commit 2a030ac9 authored by Daniel Teske's avatar Daniel Teske
Browse files

EnvironmentAspect: Fix various aspects broken in the refactoring



Switching the base environment needs to update the environment.
Fetching remote environment didn't work.

Task-number: QTCREATORBUG-9734
Change-Id: I4dd0052b364c5c3cfea17d8169de8a235d37b891
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 39f618b8
......@@ -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
......@@ -67,6 +67,7 @@ private slots:
void changeBaseEnvironment();
void userChangesEdited();
void changeUserChanges(QList<Utils::EnvironmentItem> changes);
void environmentChanged();
private:
EnvironmentAspect *m_aspect;
......
......@@ -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) :
......
......@@ -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();
}
}
}
......
......@@ -60,9 +60,6 @@ public:
QString userEnvironmentChangesAsString() const;
signals:
void remoteEnvironmentChanged();
private:
enum BaseEnvironmentBase {
CleanBaseEnvironment = 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment