From 426f64da9527baad0e0d225a3707fc8d99ed5f4c Mon Sep 17 00:00:00 2001 From: RickyRister Date: Wed, 19 Feb 2025 01:35:52 -0800 Subject: [PATCH] rename method and make it public --- cockatrice/src/game/deckview/deck_view_container.cpp | 10 ++++++---- cockatrice/src/game/deckview/deck_view_container.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cockatrice/src/game/deckview/deck_view_container.cpp b/cockatrice/src/game/deckview/deck_view_container.cpp index cb0f0869e..95b3c8155 100644 --- a/cockatrice/src/game/deckview/deck_view_container.cpp +++ b/cockatrice/src/game/deckview/deck_view_container.cpp @@ -97,7 +97,7 @@ DeckViewContainer::DeckViewContainer(int _playerId, TabGame *parent) refreshShortcuts(); connect(&SettingsCache::instance(), &SettingsCache::visualDeckStorageInGameChanged, this, - &DeckViewContainer::updateShowVisualDeckStorage); + &DeckViewContainer::setVisualDeckStorageExists); switchToDeckSelectView(); } @@ -207,11 +207,13 @@ void DeckViewContainer::refreshShortcuts() } /** - * Update VDS existence when settings change + * Updates the existence of the embedded Visual Deck Storage, destroying or creating it if needed. + * Note that this change is temporary; the VDS may get recreated when the view transitions to the deck select state, + * depending on current settings. */ -void DeckViewContainer::updateShowVisualDeckStorage(bool enabled) +void DeckViewContainer::setVisualDeckStorageExists(bool exists) { - if (enabled) { + if (exists) { // view mode state isn't stored in a field, so we determine state by checking the button if (loadLocalButton->isEnabled()) { // We only need to handle the setting changing while in deck select state; tryCreate already gets called diff --git a/cockatrice/src/game/deckview/deck_view_container.h b/cockatrice/src/game/deckview/deck_view_container.h index 7926cf54f..c841c5934 100644 --- a/cockatrice/src/game/deckview/deck_view_container.h +++ b/cockatrice/src/game/deckview/deck_view_container.h @@ -66,7 +66,6 @@ private slots: void sideboardLockButtonClicked(); void updateSideboardLockButtonText(); void refreshShortcuts(); - void updateShowVisualDeckStorage(bool enabled); signals: void newCardAdded(AbstractCardItem *card); void notIdle(); @@ -78,6 +77,7 @@ public: void readyAndUpdate(); void setSideboardLocked(bool locked); void setDeck(const DeckLoader &deck); + void setVisualDeckStorageExists(bool exists); public slots: void loadDeckFromFile(const QString &filePath);