Utils: Fix error prone default value of appendOrSet

It was not readily clear that Environment::appendOrSet/prependOrSet
needed a value for "sep", otherwise it would just concat the values without separator. This got apparent when looking at usages of
appendOrSet.

Instead there are now three options, "Auto", "Colon" or "Semicolon"
with the default being "Auto", which determines the separator based on
the Environment::OsType.

Usages of appendOrSet and prependOrSet are also fixed with this commit.

Change-Id: I868e14ce38f50be9cd07292fe3f22663a62d116d
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-01-26 10:33:29 +01:00
parent 56f42c319e
commit a25bbf23c6
11 changed files with 70 additions and 71 deletions

View File

@@ -155,7 +155,9 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
// Append QML2_IMPORT_PATH if it is defined in build configuration.
// It enables qmlplugindump to correctly dump custom plugins or other dependent
// plugins that are not installed in default Qt qml installation directory.
projectInfo.qmlDumpEnvironment.appendOrSet("QML2_IMPORT_PATH", bc->environment().expandedValueForKey("QML2_IMPORT_PATH"), ":");
projectInfo.qmlDumpEnvironment.appendOrSet("QML2_IMPORT_PATH",
bc->environment().expandedValueForKey(
"QML2_IMPORT_PATH"));
// Treat every target (library or application) in the build directory
FilePath dir = bc->buildDirectory();