From f2ce5e96938fee2d347fc4c86c2239410e35e2bd Mon Sep 17 00:00:00 2001 From: BruebachL <44814898+BruebachL@users.noreply.github.com> Date: Sun, 28 Sep 2025 11:56:45 +0200 Subject: [PATCH] [DeckEditor] Properly check if deck is blank. (#6188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [DeckEditor] Properly check if deck is blank. Took 20 minutes * Rename. Took 17 minutes --------- Co-authored-by: Lukas BrĂ¼bach --- cockatrice/src/tabs/abstract_tab_deck_editor.cpp | 2 +- common/deck_list.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/tabs/abstract_tab_deck_editor.cpp b/cockatrice/src/tabs/abstract_tab_deck_editor.cpp index fdead20c3..3bd29b577 100644 --- a/cockatrice/src/tabs/abstract_tab_deck_editor.cpp +++ b/cockatrice/src/tabs/abstract_tab_deck_editor.cpp @@ -186,7 +186,7 @@ void AbstractTabDeckEditor::setModified(bool _modified) bool AbstractTabDeckEditor::isBlankNewDeck() const { DeckLoader *deck = getDeckList(); - return !modified && deck->hasNotBeenLoaded(); + return !modified && deck->isBlankDeck() && deck->hasNotBeenLoaded(); } void AbstractTabDeckEditor::actNewDeck() diff --git a/common/deck_list.h b/common/deck_list.h index 87c826e09..0596b38fd 100644 --- a/common/deck_list.h +++ b/common/deck_list.h @@ -243,6 +243,11 @@ public: } ///@} + bool isBlankDeck() const + { + return name.isEmpty() && comments.isEmpty() && getCardList().isEmpty(); + } + /// @name Sideboard plans ///@{ QList getCurrentSideboardPlan();