RemoteLinux: Move environment handling entirely into the aspect class.

There is no reason why the run configuration should add its own logic on
top of what the aspect class does.
This makes RemoteLinuxRunConfiguration::environment() purely a
convenience method.

Change-Id: I80c4ede9a35388e7d3727fff90531accd7fc08de
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Christian Kandeler
2014-05-06 15:18:09 +02:00
parent d0e54d8e55
commit 97ece795e0
2 changed files with 7 additions and 8 deletions

View File

@@ -68,9 +68,13 @@ QString RemoteLinuxEnvironmentAspect::baseEnvironmentDisplayName(int base) const
Utils::Environment RemoteLinuxEnvironmentAspect::baseEnvironment() const
{
Utils::Environment env;
if (baseEnvironmentBase() == static_cast<int>(RemoteBaseEnvironment))
return m_remoteEnvironment;
return Utils::Environment();
env = m_remoteEnvironment;
const QString displayKey = QLatin1String("DISPLAY");
if (!env.hasKey(displayKey))
env.appendOrSet(displayKey, QLatin1String(":0.0"));
return env;
}
AbstractRemoteLinuxRunConfiguration *RemoteLinuxEnvironmentAspect::runConfiguration() const

View File

@@ -178,12 +178,7 @@ Environment RemoteLinuxRunConfiguration::environment() const
{
RemoteLinuxEnvironmentAspect *aspect = extraAspect<RemoteLinuxEnvironmentAspect>();
QTC_ASSERT(aspect, return Environment());
Environment env(OsTypeLinux);
env.modify(aspect->userEnvironmentChanges());
const QString displayKey = QLatin1String("DISPLAY");
if (!env.hasKey(displayKey))
env.appendOrSet(displayKey, QLatin1String(":0.0"));
return env;
return aspect->environment();
}
QString RemoteLinuxRunConfiguration::localExecutableFilePath() const