From 24bc713ba8069241fc43aefc8c6ecf291cedd830 Mon Sep 17 00:00:00 2001 From: RickyRister <42636155+RickyRister@users.noreply.github.com> Date: Sat, 7 Feb 2026 18:47:50 -0800 Subject: [PATCH] [DeckListModel] Fix deck hash not updating on card node add/remove (#6584) --- .../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) {