mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-27 17:13:54 -07:00
[DeckListModel] Fix deck hash not updating on card node add/remove (#6584)
This commit is contained in:
parent
4884640070
commit
24bc713ba8
1 changed files with 7 additions and 2 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue