[DeckEditor] Notify card set changes after zone edits and drop the board scan

- modifyTree emits cardNodesChanged alongside deckHashChanged so the
  banner-card combo and printing in-deck counts refresh after removing a
  zone that still holds cards
- DecklistNodeTree::findCustomZoneByName is public and moveCustomZone uses
  it, locating zones under non-standard boards (e.g. tokens) instead of
  scanning only main/side/maybeboard
This commit is contained in:
Lukas Brübach 2026-09-02 08:27:53 +02:00 committed by GitHub
parent 48ae7cf0ed
commit 2253e4ff5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 56 additions and 18 deletions

View file

@ -124,6 +124,16 @@ public:
*/
bool hasZoneName(const QString &zoneName) const;
/**
* @brief Finds a custom zone anywhere in the deck by name.
*
* Walks the children of every top-level zone, so a zone nested under any
* board (and not just the standard ones) is found.
* @param zoneName The zone name to find.
* @return The matching zone node, or nullptr if none exists.
*/
InnerDecklistNode *findCustomZoneByName(const QString &zoneName) const;
/**
* @brief Applies a function to every card in the deck tree. This can modify the cards.
*
@ -137,7 +147,6 @@ private:
InnerDecklistNode *getZoneObjFromName(const QString &zoneName) const;
InnerDecklistNode *findBoardZone(const QString &boardZoneName) const;
InnerDecklistNode *findOrCreateBoardZone(const QString &boardZoneName);
InnerDecklistNode *findCustomZoneByName(const QString &zoneName) const;
};
#endif // COCKATRICE_DECKLIST_NODE_TREE_H