EnvironmentItem: Introduce operation enumeration

Extend operations to handle prepend/append which can be optionally
determined by diff(). This allows cleanly implementing
the MSVC toolchain setup.

Amends c7a84634fd

Change-Id: Ida08d8f5e00cf5f78c20ea8d08c531b1ed22c015
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Friedemann Kleint
2017-06-23 16:54:45 +02:00
parent 59a0aeb739
commit eadd033fb9
6 changed files with 168 additions and 77 deletions

View File

@@ -4046,7 +4046,7 @@ void GdbEngine::setEnvironmentVariables()
Environment sysEnv = Environment::systemEnvironment();
Environment runEnv = runParameters().inferior.environment;
foreach (const EnvironmentItem &item, sysEnv.diff(runEnv)) {
if (item.unset)
if (item.operation == EnvironmentItem::Unset)
runCommand({"unset environment " + item.name});
else
runCommand({"-gdb-set environment " + item.name + '='