From 6418eb2ddaa60da246a03951798fbb2dfdb864f6 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 3 Aug 2021 15:12:24 +0200 Subject: Utils: Use EnvironmentChange instead of Environment in several places For path choosers this makes it easier to change the actual base retrospectively based on the device for the file path entered by the user. In other cases "end user code" only knows that something needs to be added to PATH to get a proper environment. This here lets this code to specify the change alone without bothering about the base environment this might be applied to. Change-Id: I726aaa2fd2feb0bee7158f601aac660b0ac6327b Reviewed-by: Eike Ziller --- src/plugins/vcsbase/commonvcssettings.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/plugins/vcsbase/commonvcssettings.cpp') diff --git a/src/plugins/vcsbase/commonvcssettings.cpp b/src/plugins/vcsbase/commonvcssettings.cpp index e927c22552..9d6bfe2032 100644 --- a/src/plugins/vcsbase/commonvcssettings.cpp +++ b/src/plugins/vcsbase/commonvcssettings.cpp @@ -155,10 +155,9 @@ CommonSettingsWidget::CommonSettingsWidget(CommonOptionsPage *page) void CommonSettingsWidget::updatePath() { - Environment env = Environment::systemEnvironment(); - QStringList toAdd = Core::VcsManager::additionalToolsPath(); - env.appendOrSetPath(toAdd.join(HostOsInfo::pathListSeparator())); - m_page->settings().sshPasswordPrompt.setEnvironment(env); + EnvironmentChange change; + change.addAppendToPath(Core::VcsManager::additionalToolsPath()); + m_page->settings().sshPasswordPrompt.setEnvironmentChange(change); } void CommonSettingsWidget::apply() -- cgit v1.2.1