From 6d58d111d7849954fc923798bdc0ab824056c98a Mon Sep 17 00:00:00 2001 From: RickyRister Date: Sun, 1 Feb 2026 21:03:52 -0800 Subject: [PATCH] [DeckListModel] Fix deck hash not updating on card node add/remove --- .../libcockatrice/models/deck_list/deck_list_model.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libcockatrice_models/libcockatrice/models/deck_list/deck_list_model.cpp b/libcockatrice_models/libcockatrice/models/deck_list/deck_list_model.cpp index a0624f858..8cbf23be4 100644 --- a/libcockatrice_models/libcockatrice/models/deck_list/deck_list_model.cpp +++ b/libcockatrice_models/libcockatrice/models/deck_list/deck_list_model.cpp @@ -340,6 +340,9 @@ bool DeckListModel::removeRows(int row, int count, const QModelIndex &parent) emitRecursiveUpdates(parent); } + deckList->refreshDeckHash(); + emit deckHashChanged(); + return true; } @@ -448,8 +451,6 @@ QModelIndex DeckListModel::addCard(const ExactCard &card, const QString &zoneNam cardNode->setCardSetShortName(cardSetName); cardNode->setCardCollectorNumber(printingInfo.getProperty("num")); cardNode->setCardProviderId(printingInfo.getProperty("uuid")); - deckList->refreshDeckHash(); - emit deckHashChanged(); // Emit dataChanged for the amount column since we modified it QModelIndex cardIndex = nodeToIndex(cardNode); QModelIndex amountIndex = cardIndex.sibling(cardIndex.row(), DeckListModelColumns::CARD_AMOUNT); @@ -458,6 +459,10 @@ QModelIndex DeckListModel::addCard(const ExactCard &card, const QString &zoneNam sort(lastKnownColumn, lastKnownOrder); refreshCardFormatLegalities(); emitRecursiveUpdates(parentIndex); + + deckList->refreshDeckHash(); + emit deckHashChanged(); + auto index = nodeToIndex(cardNode); if (cardNodeAdded) {