[DeckList] Drop const from zone lookup that creates nodes (#7304)

DecklistNodeTree::getZoneObjFromName creates a new zone node when
the name is unknown, so declaring it const was a lie that let a
const DecklistNodeTree mutate its tree. It is only called from
mutating paths (addCard, readZoneElement), so the const qualifier
is removed.

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-09-18 11:58:30 +02:00 committed by GitHub
parent 733deac0bb
commit f4d5fc181d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -197,7 +197,7 @@ void DecklistNodeTree::forEachCard(const std::function<void(InnerDecklistNode *,
* Top-level zones take precedence, then deck-unique custom zones nested under boards
* are resolved. Unknown names create a new top-level zone (legacy behavior).
*/
InnerDecklistNode *DecklistNodeTree::getZoneObjFromName(const QString &zoneName) const
InnerDecklistNode *DecklistNodeTree::getZoneObjFromName(const QString &zoneName)
{
for (int i = 0; i < root->size(); i++) {
auto *node = dynamic_cast<InnerDecklistNode *>(root->at(i));

View file

@ -144,7 +144,7 @@ public:
private:
// Helpers for traversing the tree
InnerDecklistNode *getZoneObjFromName(const QString &zoneName) const;
InnerDecklistNode *getZoneObjFromName(const QString &zoneName);
InnerDecklistNode *findBoardZone(const QString &boardZoneName) const;
InnerDecklistNode *findOrCreateBoardZone(const QString &boardZoneName);
};