From 53ce9d53d553ed8cd988fec6d32c9198fa929e38 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 11 Oct 2023 15:05:35 +0200 Subject: [PATCH] Loader: Restore candidates when switching preferred value ... on the final module properties merge. Fixes: QBS-1763 Change-Id: Ie57f0e493ffb90a36cd0c6cd9c1bd48ccac0e42f Reviewed-by: Ivan Komissarov --- src/lib/corelib/loader/modulepropertymerger.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/corelib/loader/modulepropertymerger.cpp b/src/lib/corelib/loader/modulepropertymerger.cpp index abadd5b349..a789d1adcb 100644 --- a/src/lib/corelib/loader/modulepropertymerger.cpp +++ b/src/lib/corelib/loader/modulepropertymerger.cpp @@ -287,6 +287,11 @@ bool ModulePropertyMerger::doFinalMerge(const PropertyDeclaration &propertyDecl, if (propertyValue == chosenValue) return false; + std::vector candidates = propertyValue->candidates(); + candidates.erase(std::find(candidates.begin(), candidates.end(), chosenValue)); + chosenValue->setCandidates(candidates); + chosenValue->addCandidate(propertyValue); + propertyValue->setCandidates({}); propertyValue = chosenValue; return true; }