Skip to content

Commit

Permalink
Loader: Restore candidates when switching preferred value
Browse files Browse the repository at this point in the history
... on the final module properties merge.

Fixes: QBS-1763
Change-Id: Ie57f0e493ffb90a36cd0c6cd9c1bd48ccac0e42f
Reviewed-by: Ivan Komissarov <[email protected]>
  • Loading branch information
ckandeler committed Oct 16, 2023
1 parent 7f47efe commit 53ce9d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/corelib/loader/modulepropertymerger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ bool ModulePropertyMerger::doFinalMerge(const PropertyDeclaration &propertyDecl,

if (propertyValue == chosenValue)
return false;
std::vector<ValuePtr> candidates = propertyValue->candidates();
candidates.erase(std::find(candidates.begin(), candidates.end(), chosenValue));
chosenValue->setCandidates(candidates);
chosenValue->addCandidate(propertyValue);
propertyValue->setCandidates({});
propertyValue = chosenValue;
return true;
}
Expand Down

0 comments on commit 53ce9d5

Please sign in to comment.