forked from qt-creator/qt-creator
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: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user