diff options
author | hjk <hjk@qt.io> | 2019-03-07 10:10:22 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-03-11 12:40:51 +0000 |
commit | 6faaea8d0c35c0c957784a5531762e971c2cca91 (patch) | |
tree | 9138838092b555ae4960818d26ef965899d490c2 /src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp | |
parent | 9606e240f77801693e1ae30b1db8faf5b9531176 (diff) |
ProjectExplorer: Split EnvironmentAspect
... at least logically a bit more into hunks responsible for
one of the possible choices of base environments.
This makes it possible to move code that modifies individual
cases closer to the only place that uses it.
Change-Id: I1c87bb869e04e44b92ff097b0bf25274f93808be
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp')
-rw-r--r-- | src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp index aaaae8e68f..36d2d03e2d 100644 --- a/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp +++ b/src/plugins/remotelinux/remotelinuxenvironmentaspect.cpp @@ -41,40 +41,21 @@ static bool displayAlreadySet(const QList<Utils::EnvironmentItem> &changes) }); } -enum BaseEnvironmentBase { - CleanBaseEnvironment = 0, - RemoteBaseEnvironment = 1 -}; - - RemoteLinuxEnvironmentAspect::RemoteLinuxEnvironmentAspect(ProjectExplorer::Target *target) { - addSupportedBaseEnvironment(CleanBaseEnvironment, tr("Clean Environment")); - addPreferredBaseEnvironment(RemoteBaseEnvironment, tr("System Environment")); + addSupportedBaseEnvironment(tr("Clean Environment"), {}); + addPreferredBaseEnvironment(tr("System Environment"), [this] { return m_remoteEnvironment; }); setConfigWidgetCreator([this, target] { return new RemoteLinuxEnvironmentAspectWidget(this, target); }); - - setBaseEnvironmentGetter([this] { - Utils::Environment env; - if (baseEnvironmentBase() == static_cast<int>(RemoteBaseEnvironment)) - env = m_remoteEnvironment; - return env; - }); -} - -Utils::Environment RemoteLinuxEnvironmentAspect::remoteEnvironment() const -{ - return m_remoteEnvironment; } void RemoteLinuxEnvironmentAspect::setRemoteEnvironment(const Utils::Environment &env) { if (env != m_remoteEnvironment) { m_remoteEnvironment = env; - if (baseEnvironmentBase() == static_cast<int>(RemoteBaseEnvironment)) - emit environmentChanged(); + emit environmentChanged(); } } |