Core: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*

And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).

Change-Id: Idfc8a7e255b4a0527f4651d6f9e5334e95b4351f
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Eike Ziller
2022-08-24 14:55:41 +02:00
parent d5bacfc087
commit 54bce73089
3 changed files with 12 additions and 8 deletions

View File

@@ -138,7 +138,7 @@ static void startTerminalEmulator(const QString &workingDir, const Environment &
}
return programName;
};
const QString cmdLine = quoteWinCommand(QString::fromLocal8Bit(qgetenv("COMSPEC")));
const QString cmdLine = quoteWinCommand(qtcEnvironmentVariable("COMSPEC"));
// cmdLine is assumed to be detached -
// https://blogs.msdn.microsoft.com/oldnewthing/20090601-00/?p=18083