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(baseEnvironmentChanged()), this, SLOT(changeBaseEnvironment()));
|
||||||
connect(m_aspect, SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)),
|
connect(m_aspect, SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)),
|
||||||
this, SLOT(changeUserChanges(QList<Utils::EnvironmentItem>)));
|
this, SLOT(changeUserChanges(QList<Utils::EnvironmentItem>)));
|
||||||
|
connect(m_aspect, SIGNAL(environmentChanged()),
|
||||||
|
this, SLOT(environmentChanged()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString EnvironmentAspectWidget::displayName() const
|
QString EnvironmentAspectWidget::displayName() const
|
||||||
@@ -118,6 +120,7 @@ void EnvironmentAspectWidget::baseEnvironmentSelected(int idx)
|
|||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_aspect->setBaseEnvironmentBase(m_baseEnvironmentComboBox->itemData(idx).toInt());
|
m_aspect->setBaseEnvironmentBase(m_baseEnvironmentComboBox->itemData(idx).toInt());
|
||||||
|
m_environmentWidget->setBaseEnvironment(m_aspect->baseEnvironment());
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,6 +135,7 @@ void EnvironmentAspectWidget::changeBaseEnvironment()
|
|||||||
m_baseEnvironmentComboBox->setCurrentIndex(i);
|
m_baseEnvironmentComboBox->setCurrentIndex(i);
|
||||||
}
|
}
|
||||||
m_environmentWidget->setBaseEnvironmentText(m_aspect->baseEnvironmentDisplayName(base));
|
m_environmentWidget->setBaseEnvironmentText(m_aspect->baseEnvironmentDisplayName(base));
|
||||||
|
m_environmentWidget->setBaseEnvironment(m_aspect->baseEnvironment());
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnvironmentAspectWidget::userChangesEdited()
|
void EnvironmentAspectWidget::userChangesEdited()
|
||||||
@@ -148,4 +152,11 @@ void EnvironmentAspectWidget::changeUserChanges(QList<Utils::EnvironmentItem> ch
|
|||||||
m_environmentWidget->setUserChanges(changes);
|
m_environmentWidget->setUserChanges(changes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EnvironmentAspectWidget::environmentChanged()
|
||||||
|
{
|
||||||
|
if (m_ignoreChange)
|
||||||
|
return;
|
||||||
|
m_environmentWidget->setBaseEnvironment(m_aspect->baseEnvironment());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ private slots:
|
|||||||
void changeBaseEnvironment();
|
void changeBaseEnvironment();
|
||||||
void userChangesEdited();
|
void userChangesEdited();
|
||||||
void changeUserChanges(QList<Utils::EnvironmentItem> changes);
|
void changeUserChanges(QList<Utils::EnvironmentItem> changes);
|
||||||
|
void environmentChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EnvironmentAspect *m_aspect;
|
EnvironmentAspect *m_aspect;
|
||||||
|
|||||||
@@ -84,10 +84,8 @@ Utils::Environment LocalEnvironmentAspect::baseEnvironment() const
|
|||||||
|
|
||||||
void LocalEnvironmentAspect::buildEnvironmentHasChanged()
|
void LocalEnvironmentAspect::buildEnvironmentHasChanged()
|
||||||
{
|
{
|
||||||
if (baseEnvironmentBase() == static_cast<int>(BuildEnvironmentBase)) {
|
if (baseEnvironmentBase() == static_cast<int>(BuildEnvironmentBase))
|
||||||
emit baseEnvironmentChanged();
|
|
||||||
emit environmentChanged();
|
emit environmentChanged();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LocalEnvironmentAspect::LocalEnvironmentAspect(RunConfiguration *rc) :
|
LocalEnvironmentAspect::LocalEnvironmentAspect(RunConfiguration *rc) :
|
||||||
|
|||||||
@@ -87,12 +87,9 @@ void RemoteLinuxEnvironmentAspect::setRemoteEnvironment(const Utils::Environment
|
|||||||
{
|
{
|
||||||
if (env != m_remoteEnvironment) {
|
if (env != m_remoteEnvironment) {
|
||||||
m_remoteEnvironment = env;
|
m_remoteEnvironment = env;
|
||||||
emit remoteEnvironmentChanged();
|
if (baseEnvironmentBase() == static_cast<int>(RemoteBaseEnvironment))
|
||||||
if (baseEnvironmentBase() == static_cast<int>(RemoteBaseEnvironment)) {
|
|
||||||
emit baseEnvironmentChanged();
|
|
||||||
emit environmentChanged();
|
emit environmentChanged();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString RemoteLinuxEnvironmentAspect::userEnvironmentChangesAsString() const
|
QString RemoteLinuxEnvironmentAspect::userEnvironmentChangesAsString() const
|
||||||
|
|||||||
@@ -60,9 +60,6 @@ public:
|
|||||||
|
|
||||||
QString userEnvironmentChangesAsString() const;
|
QString userEnvironmentChangesAsString() const;
|
||||||
|
|
||||||
signals:
|
|
||||||
void remoteEnvironmentChanged();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum BaseEnvironmentBase {
|
enum BaseEnvironmentBase {
|
||||||
CleanBaseEnvironment = 0,
|
CleanBaseEnvironment = 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user