forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user