From 875df01424ee681aceecc6ea904fabda32ca2816 Mon Sep 17 00:00:00 2001 From: Buce Date: Tue, 18 Feb 2014 19:52:23 -0600 Subject: [PATCH] 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. --- cockatrice/src/decklistmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cockatrice/src/decklistmodel.cpp b/cockatrice/src/decklistmodel.cpp index fdf222aab..758e540b3 100644 --- a/cockatrice/src/decklistmodel.cpp +++ b/cockatrice/src/decklistmodel.cpp @@ -256,11 +256,11 @@ QModelIndex DeckListModel::addCard(const QString &cardName, const QString &zoneN return nodeToIndex(cardNode); } else { cardNode->setNumber(cardNode->getNumber() + 1); - QModelIndex ind = nodeToIndex(cardNode); + QModelIndex parentIndex = nodeToIndex(cardTypeNode); sort(lastKnownColumn, lastKnownOrder); - emitRecursiveUpdates(ind); + emitRecursiveUpdates(parentIndex); deckList->updateDeckHash(); - return ind; + return nodeToIndex(cardNode); } }