[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);
}
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) {