[DeckList] Drop const from zone lookup that creates nodes

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.
This commit is contained in:
Lukas Brübach 2026-09-17 15:13:51 +02:00 committed by GitHub
parent f79f0d0460
commit 2486f73067
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);
};