VCS: 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: I364e5b663353f37121279a58f4a9fd514cddbbf0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Eike Ziller
2022-08-24 14:54:30 +02:00
parent d454184467
commit 025bdfe702
4 changed files with 13 additions and 13 deletions

View File

@@ -2244,11 +2244,10 @@ Environment GitClient::processEnvironment() const
environment.prependOrSetPath(FilePath::fromUserInput(gitPath));
if (HostOsInfo::isWindowsHost() && settings().winSetHomeEnvironment.value()) {
QString homePath;
if (qEnvironmentVariableIsEmpty("HOMESHARE")) {
if (qtcEnvironmentVariableIsEmpty("HOMESHARE")) {
homePath = QDir::toNativeSeparators(QDir::homePath());
} else {
homePath = QString::fromLocal8Bit(qgetenv("HOMEDRIVE"))
+ QString::fromLocal8Bit(qgetenv("HOMEPATH"));
homePath = qtcEnvironmentVariable("HOMEDRIVE") + qtcEnvironmentVariable("HOMEPATH");
}
environment.set("HOME", homePath);
}