Environment: Fix incorrect usage of appendOrSet

appendOrSet will append to existing environment variables which is not
what we want for all the changed locations in this commit.

Change-Id: Icf6b110acc59261659839375672943ec21923da1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-01-26 10:34:47 +01:00
parent b8c9d79b9f
commit dbee11f5b4
5 changed files with 8 additions and 9 deletions

View File

@@ -179,8 +179,8 @@ void LldbEngine::setupEngine()
showMessage("STARTING LLDB: " + lldbCmd.toUserOutput());
Environment environment = runParameters().debugger.environment;
environment.appendOrSet("QT_CREATOR_LLDB_PROCESS", "1");
environment.appendOrSet("PYTHONUNBUFFERED", "1"); // avoid flushing problem on macOS
environment.set("QT_CREATOR_LLDB_PROCESS", "1");
environment.set("PYTHONUNBUFFERED", "1"); // avoid flushing problem on macOS
DebuggerItem::addAndroidLldbPythonEnv(lldbCmd, environment);
if (lldbCmd.osType() == OsTypeLinux) {

View File

@@ -1679,7 +1679,7 @@ void openOldEffectMaker(const QString &filePath)
arguments << "--exportpath" << effectResPath.toString();
if (env.osType() == Utils::OsTypeMac)
env.appendOrSet("QSG_RHI_BACKEND", "metal");
env.set("QSG_RHI_BACKEND", "metal");
Utils::Process *qqemProcess = new Utils::Process();
qqemProcess->setEnvironment(env);

View File

@@ -149,7 +149,7 @@ void PuppetEnvironmentBuilder::addControls() const
const QString styleConfigFileName = getStyleConfigFileName();
if (!styleConfigFileName.isEmpty())
m_environment.appendOrSet("QT_QUICK_CONTROLS_CONF", styleConfigFileName);
m_environment.set("QT_QUICK_CONTROLS_CONF", styleConfigFileName);
}
void PuppetEnvironmentBuilder::addPixelRatio() const
@@ -238,8 +238,7 @@ void PuppetEnvironmentBuilder::addCustomFileSelectors() const
customFileSelectors.append("DesignMode");
if (!customFileSelectors.isEmpty())
m_environment.appendOrSet("QML_FILE_SELECTORS",
customFileSelectors.join(","));
m_environment.set("QML_FILE_SELECTORS", customFileSelectors.join(","));
qCInfo(puppetEnvirmentBuild) << "Puppet selectors:" << customFileSelectors;
}

View File

@@ -704,8 +704,8 @@ Environment SquishTools::squishEnvironment()
{
Environment environment = Environment::systemEnvironment();
if (!toolsSettings.licenseKeyPath.isEmpty())
environment.prependOrSet("SQUISH_LICENSEKEY_DIR", toolsSettings.licenseKeyPath.nativePath());
environment.prependOrSet("SQUISH_PREFIX", toolsSettings.squishPath.nativePath());
environment.set("SQUISH_LICENSEKEY_DIR", toolsSettings.licenseKeyPath.nativePath());
environment.set("SQUISH_PREFIX", toolsSettings.squishPath.nativePath());
return environment;
}

View File

@@ -47,7 +47,7 @@ private slots:
+ QLatin1String(TEST_RELATIVE_LIBEXEC_PATH));
LauncherInterface::setPathToLauncher(libExecPath);
testEnv.appendOrSet("TEST_ECHO", "1");
testEnv.set("TEST_ECHO", "1");
if (HostOsInfo::isWindowsHost())
newLine = "\r\n";