From 97ece795e092cf2b26f7ec84bdd5135fa70a8876 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 6 May 2014 15:18:09 +0200 Subject: [PATCH] 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 --- src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp | 8 ++++++-- src/plugins/remotelinux/remotelinuxrunconfiguration.cpp | 7 +------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp index d06c6d88134..2f6c2fac9d1 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp @@ -68,9 +68,13 @@ QString RemoteLinuxEnvironmentAspect::baseEnvironmentDisplayName(int base) const Utils::Environment RemoteLinuxEnvironmentAspect::baseEnvironment() const { + Utils::Environment env; if (baseEnvironmentBase() == static_cast(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 diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index dbdd2698478..3a906f7cb1a 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -178,12 +178,7 @@ Environment RemoteLinuxRunConfiguration::environment() const { RemoteLinuxEnvironmentAspect *aspect = extraAspect(); 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