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 <eike.ziller@qt.io>
This commit is contained in:
hjk
2021-08-03 15:12:24 +02:00
parent 6405f9c436
commit 6418eb2dda
13 changed files with 59 additions and 42 deletions

View File

@@ -317,10 +317,9 @@ void SystemSettingsWidget::resetFileBrowser()
void SystemSettingsWidget::updatePath()
{
Environment env = Environment::systemEnvironment();
QStringList toAdd = VcsManager::additionalToolsPath();
env.appendOrSetPath(toAdd.join(HostOsInfo::pathListSeparator()));
m_ui.patchChooser->setEnvironment(env);
EnvironmentChange change;
change.addAppendToPath(VcsManager::additionalToolsPath());
m_ui.patchChooser->setEnvironmentChange(change);
}
void SystemSettingsWidget::updateEnvironmentChangesLabel()