[DeckListModel] Fix deck hash not updating on card node add/remove (#6584)

This commit is contained in:
RickyRister 2026-02-07 18:47:50 -08:00 committed by GitHub
parent 4884640070
commit 24bc713ba8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -340,6 +340,9 @@ bool DeckListModel::removeRows(int row, int count, const QModelIndex &parent)
emitRecursiveUpdates(parent); emitRecursiveUpdates(parent);
} }
deckList->refreshDeckHash();
emit deckHashChanged();
return true; return true;
} }
@ -448,8 +451,6 @@ QModelIndex DeckListModel::addCard(const ExactCard &card, const QString &zoneNam
cardNode->setCardSetShortName(cardSetName); cardNode->setCardSetShortName(cardSetName);
cardNode->setCardCollectorNumber(printingInfo.getProperty("num")); cardNode->setCardCollectorNumber(printingInfo.getProperty("num"));
cardNode->setCardProviderId(printingInfo.getProperty("uuid")); cardNode->setCardProviderId(printingInfo.getProperty("uuid"));
deckList->refreshDeckHash();
emit deckHashChanged();
// Emit dataChanged for the amount column since we modified it // Emit dataChanged for the amount column since we modified it
QModelIndex cardIndex = nodeToIndex(cardNode); QModelIndex cardIndex = nodeToIndex(cardNode);
QModelIndex amountIndex = cardIndex.sibling(cardIndex.row(), DeckListModelColumns::CARD_AMOUNT); 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); sort(lastKnownColumn, lastKnownOrder);
refreshCardFormatLegalities(); refreshCardFormatLegalities();
emitRecursiveUpdates(parentIndex); emitRecursiveUpdates(parentIndex);
deckList->refreshDeckHash();
emit deckHashChanged();
auto index = nodeToIndex(cardNode); auto index = nodeToIndex(cardNode);
if (cardNodeAdded) { if (cardNodeAdded) {