From eb5ccd1a42b6135e6535e0d52427b66bccf67ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Sat, 27 Sep 2025 07:54:19 +0200 Subject: [PATCH] [DeckEditor] Properly check if deck is blank. Took 20 minutes --- 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..66c5b3bec 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->isUnmodified() && deck->hasNotBeenLoaded(); } void AbstractTabDeckEditor::actNewDeck() diff --git a/common/deck_list.h b/common/deck_list.h index 87c826e09..9c4c8211a 100644 --- a/common/deck_list.h +++ b/common/deck_list.h @@ -243,6 +243,11 @@ public: } ///@} + bool isUnmodified() const + { + return name.isEmpty() && comments.isEmpty() && getCardList().size() == 0; + } + /// @name Sideboard plans ///@{ QList getCurrentSideboardPlan();