forked from qt-creator/qt-creator
Run configurations: Let env widget reflect changes to lib search path
This broke in some refactoring. Fixes: QTCREATORBUG-23165 Change-Id: Icb98234d83c6cb45a68562b88ee11fc9453bf6b3 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -72,12 +72,18 @@ void EnvironmentAspect::setUserEnvironmentChanges(const Utils::EnvironmentItems
|
|||||||
}
|
}
|
||||||
|
|
||||||
Utils::Environment EnvironmentAspect::environment() const
|
Utils::Environment EnvironmentAspect::environment() const
|
||||||
|
{
|
||||||
|
Environment env = modifiedBaseEnvironment();
|
||||||
|
env.modify(m_userChanges);
|
||||||
|
return env;
|
||||||
|
}
|
||||||
|
|
||||||
|
Environment EnvironmentAspect::modifiedBaseEnvironment() const
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_base >= 0 && m_base < m_baseEnvironments.size(), return Environment());
|
QTC_ASSERT(m_base >= 0 && m_base < m_baseEnvironments.size(), return Environment());
|
||||||
Environment env = m_baseEnvironments.at(m_base).unmodifiedBaseEnvironment();
|
Environment env = m_baseEnvironments.at(m_base).unmodifiedBaseEnvironment();
|
||||||
for (const EnvironmentModifier &modifier : m_modifiers)
|
for (const EnvironmentModifier &modifier : m_modifiers)
|
||||||
modifier(env);
|
modifier(env);
|
||||||
env.modify(m_userChanges);
|
|
||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,6 +46,9 @@ public:
|
|||||||
// The environment including the user's modifications.
|
// The environment including the user's modifications.
|
||||||
Utils::Environment environment() const;
|
Utils::Environment environment() const;
|
||||||
|
|
||||||
|
// Environment including modifiers, but without explicit user changes.
|
||||||
|
Utils::Environment modifiedBaseEnvironment() const;
|
||||||
|
|
||||||
int baseEnvironmentBase() const;
|
int baseEnvironmentBase() const;
|
||||||
void setBaseEnvironmentBase(int base);
|
void setBaseEnvironmentBase(int base);
|
||||||
|
|
||||||
@@ -57,7 +60,7 @@ public:
|
|||||||
void addPreferredBaseEnvironment(const QString &displayName,
|
void addPreferredBaseEnvironment(const QString &displayName,
|
||||||
const std::function<Utils::Environment()> &getter);
|
const std::function<Utils::Environment()> &getter);
|
||||||
|
|
||||||
// The environment the user chose as base for his modifications.
|
// The pure base environment.
|
||||||
Utils::Environment currentUnmodifiedBaseEnvironment() const;
|
Utils::Environment currentUnmodifiedBaseEnvironment() const;
|
||||||
QString currentDisplayName() const;
|
QString currentDisplayName() const;
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@ EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect, QWid
|
|||||||
const EnvironmentWidget::Type widgetType = aspect->isLocal()
|
const EnvironmentWidget::Type widgetType = aspect->isLocal()
|
||||||
? EnvironmentWidget::TypeLocal : EnvironmentWidget::TypeRemote;
|
? EnvironmentWidget::TypeLocal : EnvironmentWidget::TypeRemote;
|
||||||
m_environmentWidget = new EnvironmentWidget(this, widgetType, baseEnvironmentWidget);
|
m_environmentWidget = new EnvironmentWidget(this, widgetType, baseEnvironmentWidget);
|
||||||
m_environmentWidget->setBaseEnvironment(m_aspect->currentUnmodifiedBaseEnvironment());
|
m_environmentWidget->setBaseEnvironment(m_aspect->modifiedBaseEnvironment());
|
||||||
m_environmentWidget->setBaseEnvironmentText(m_aspect->currentDisplayName());
|
m_environmentWidget->setBaseEnvironmentText(m_aspect->currentDisplayName());
|
||||||
m_environmentWidget->setUserChanges(m_aspect->userEnvironmentChanges());
|
m_environmentWidget->setUserChanges(m_aspect->userEnvironmentChanges());
|
||||||
m_environmentWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
m_environmentWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
@@ -106,7 +106,7 @@ void EnvironmentAspectWidget::baseEnvironmentSelected(int idx)
|
|||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_aspect->setBaseEnvironmentBase(idx);
|
m_aspect->setBaseEnvironmentBase(idx);
|
||||||
m_environmentWidget->setBaseEnvironment(m_aspect->currentUnmodifiedBaseEnvironment());
|
m_environmentWidget->setBaseEnvironment(m_aspect->modifiedBaseEnvironment());
|
||||||
m_environmentWidget->setBaseEnvironmentText(m_aspect->currentDisplayName());
|
m_environmentWidget->setBaseEnvironmentText(m_aspect->currentDisplayName());
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ void EnvironmentAspectWidget::changeBaseEnvironment()
|
|||||||
m_baseEnvironmentComboBox->setCurrentIndex(i);
|
m_baseEnvironmentComboBox->setCurrentIndex(i);
|
||||||
}
|
}
|
||||||
m_environmentWidget->setBaseEnvironmentText(m_aspect->currentDisplayName());
|
m_environmentWidget->setBaseEnvironmentText(m_aspect->currentDisplayName());
|
||||||
m_environmentWidget->setBaseEnvironment(m_aspect->currentUnmodifiedBaseEnvironment());
|
m_environmentWidget->setBaseEnvironment(m_aspect->modifiedBaseEnvironment());
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnvironmentAspectWidget::userChangesEdited()
|
void EnvironmentAspectWidget::userChangesEdited()
|
||||||
@@ -143,7 +143,7 @@ void EnvironmentAspectWidget::environmentChanged()
|
|||||||
{
|
{
|
||||||
if (m_ignoreChange)
|
if (m_ignoreChange)
|
||||||
return;
|
return;
|
||||||
m_environmentWidget->setBaseEnvironment(m_aspect->currentUnmodifiedBaseEnvironment());
|
m_environmentWidget->setBaseEnvironment(m_aspect->modifiedBaseEnvironment());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
Reference in New Issue
Block a user