Commit b3bccbc2 authored by dt's avatar dt
Browse files

Adjust environment to changes in the baseenvironment

parent 153f6aab
......@@ -151,7 +151,8 @@ signals:
void removedRunConfiguration(const QString &name);
void addedRunConfiguration(const QString &name);
// This signal is jut there for updating the tree list in the buildsettings wizard
void buildConfigurationDisplayNameChanged(const QString &buildConfiguraiton);
void buildConfigurationDisplayNameChanged(const QString &buildConfiguration);
void environmentChanged(const QString &buildConfiguration);
protected:
/* This method is called when the project .user file is saved. Simply call
......
......@@ -724,7 +724,10 @@ ProjectExplorer::Environment Qt4Project::environment(const QString &buildConfigu
void Qt4Project::setUseSystemEnvironment(const QString &buildConfiguration, bool b)
{
if (useSystemEnvironment(buildConfiguration) == b)
return;
setValue(buildConfiguration, "clearSystemEnvironment", !b);
emit environmentChanged(buildConfiguration);
}
bool Qt4Project::useSystemEnvironment(const QString &buildConfiguration) const
......@@ -740,7 +743,11 @@ QList<ProjectExplorer::EnvironmentItem> Qt4Project::userEnvironmentChanges(const
void Qt4Project::setUserEnvironmentChanges(const QString &buildConfig, const QList<ProjectExplorer::EnvironmentItem> &diff)
{
setValue(buildConfig, "userEnvironmentChanges", EnvironmentItem::toStringList(diff));
QStringList list = EnvironmentItem::toStringList(diff);
if (list == value(buildConfig, "userEnvironmentChanges").toStringList())
return;
setValue(buildConfig, "userEnvironmentChanges", list);
emit environmentChanged(buildConfig);
}
QString Qt4Project::qtDir(const QString &buildConfiguration) const
......
......@@ -71,6 +71,12 @@ Qt4RunConfiguration::Qt4RunConfiguration(Qt4Project *pro, const QString &proFile
connect(pro, SIGNAL(activeBuildConfigurationChanged()),
this, SLOT(invalidateCachedTargetInformation()));
connect(pro, SIGNAL(activeBuildConfigurationChanged()),
this, SIGNAL(baseEnvironmentChanged()));
connect(pro, SIGNAL(environmentChanged(QString)),
this, SIGNAL(baseEnvironmentChanged()));
}
Qt4RunConfiguration::~Qt4RunConfiguration()
......@@ -178,6 +184,13 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
connect(qt4RunConfiguration, SIGNAL(userEnvironmentChangesChanged(QList<ProjectExplorer::EnvironmentItem>)),
this, SLOT(userEnvironmentChangesChanged(QList<ProjectExplorer::EnvironmentItem>)));
connect(qt4RunConfiguration, SIGNAL(baseEnvironmentChanged()),
this, SLOT(baseEnvironmentChanged()));
}
void Qt4RunConfigurationWidget::baseEnvironmentChanged()
{
m_environmentWidget->setBaseEnvironment(m_qt4RunConfiguration->baseEnvironment());
}
void Qt4RunConfigurationWidget::userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &userChanges)
......
......@@ -93,6 +93,7 @@ signals:
void workingDirectoryChanged(const QString&);
void runModeChanged(ProjectExplorer::ApplicationRunConfiguration::RunMode runMode);
void usingDyldImageSuffixChanged(bool);
void baseEnvironmentChanged();
void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &diff);
// note those signals might not emited for every change
......@@ -147,6 +148,7 @@ private slots:
void nameChanged(const QString &name);
void runModeChanged(ProjectExplorer::ApplicationRunConfiguration::RunMode runMode);
void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &userChanges);
void baseEnvironmentChanged();
void effectiveTargetInformationChanged();
void termToggled(bool);
......
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