Commit 875df014 authored by Buce's avatar Buce
Browse files

Fix GUI glitches when adding cards to a deck

Since we no longer sort on just card names, we need to emit updates
for the parent of the card we add.
parent b32374b4
...@@ -256,11 +256,11 @@ QModelIndex DeckListModel::addCard(const QString &cardName, const QString &zoneN ...@@ -256,11 +256,11 @@ QModelIndex DeckListModel::addCard(const QString &cardName, const QString &zoneN
return nodeToIndex(cardNode); return nodeToIndex(cardNode);
} else { } else {
cardNode->setNumber(cardNode->getNumber() + 1); cardNode->setNumber(cardNode->getNumber() + 1);
QModelIndex ind = nodeToIndex(cardNode); QModelIndex parentIndex = nodeToIndex(cardTypeNode);
sort(lastKnownColumn, lastKnownOrder); sort(lastKnownColumn, lastKnownOrder);
emitRecursiveUpdates(ind); emitRecursiveUpdates(parentIndex);
deckList->updateDeckHash(); deckList->updateDeckHash();
return ind; return nodeToIndex(cardNode);
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment