aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2023-04-25 17:01:11 +0200
committerCristian Adam <cristian.adam@qt.io>2023-04-27 08:00:53 +0000
commit65a1637d61b1c6432eec0ebd99094569911ede90 (patch)
treebebe893fc2b04cef7ef0cd749a70b40d9205d674
parent8482e2405e23c6ee65a8f4f60c10e05851396cf5 (diff)
CMakePM: Fix presets transitive inheritance
Fixes: QTCREATORBUG-29076 Change-Id: Ibe4c3eebb3fcebeabafc485949a19e696ecad2de Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
index ecf3228d31..ae6e26f9e3 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
@@ -100,7 +100,9 @@ Internal::PresetsData CMakeProject::combinePresets(Internal::PresetsData &cmakeP
Utils::sort(presetsList, [](const auto &left, const auto &right) {
const bool sameInheritance = left.inherits && right.inherits
&& left.inherits.value() == right.inherits.value();
- if (!left.inherits || left.inherits.value().contains(right.name) || sameInheritance)
+ const bool leftInheritsRight = left.inherits
+ && left.inherits.value().contains(right.name);
+ if ((left.inherits && !right.inherits) || leftInheritsRight || sameInheritance)
return false;
return true;
});