Merge remote-tracking branch 'origin/13.0' into 14.0

Change-Id: I7ca7fc0d963b30257fd735eca8b00aedef1443ae
This commit is contained in:
Eike Ziller
2024-06-06 09:01:03 +02:00
2 changed files with 21 additions and 4 deletions

View File

@@ -28,9 +28,17 @@ Editing
* Fixed that `Use Qt module name in #include-directive` used Qt 4 module names * Fixed that `Use Qt module name in #include-directive` used Qt 4 module names
([QTCREATORBUG-30751](https://bugreports.qt.io/browse/QTCREATORBUG-30751)) ([QTCREATORBUG-30751](https://bugreports.qt.io/browse/QTCREATORBUG-30751))
### Copilot
* Adapted to changes in the Copilot neovim plugin
Projects Projects
-------- --------
### CMake
* Fixed the environment macro expansion for Presets
### Meson ### Meson
* Fixed a crash when selecting kits * Fixed a crash when selecting kits

View File

@@ -139,11 +139,13 @@ void expand(const PresetType &preset, Environment &env, const FilePath &sourceDi
return presetEnv.value(macroName); return presetEnv.value(macroName);
}); });
bool append = true; enum Operation { set, appendOrSet, prependOrSet };
Operation op = set;
if (key.compare("PATH", Qt::CaseInsensitive) == 0) { if (key.compare("PATH", Qt::CaseInsensitive) == 0) {
op = appendOrSet;
const int index = value.indexOf("$penv{PATH}", 0, Qt::CaseInsensitive); const int index = value.indexOf("$penv{PATH}", 0, Qt::CaseInsensitive);
if (index != 0) if (index != 0)
append = false; op = prependOrSet;
value.replace("$penv{PATH}", "", Qt::CaseInsensitive); value.replace("$penv{PATH}", "", Qt::CaseInsensitive);
} }
@@ -154,10 +156,17 @@ void expand(const PresetType &preset, Environment &env, const FilePath &sourceDi
// Make sure to expand the CMake macros also for environment variables // Make sure to expand the CMake macros also for environment variables
expandAllButEnv(preset, sourceDirectory, value); expandAllButEnv(preset, sourceDirectory, value);
if (append) switch (op) {
case set:
env.set(key, value);
break;
case appendOrSet:
env.appendOrSet(key, value); env.appendOrSet(key, value);
else break;
case prependOrSet:
env.prependOrSet(key, value); env.prependOrSet(key, value);
break;
}
}); });
} }