From cab1e096dfe98f495c67a81b4e7654a7ada0571a Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sat, 4 Apr 2015 12:49:28 +0200 Subject: [PATCH] Fix #118 Fix selection problem when sorting the deck list --- 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 c55af013..8a3b8b0f 100644 --- a/cockatrice/src/decklistmodel.cpp +++ b/cockatrice/src/decklistmodel.cpp @@ -311,9 +311,9 @@ void DeckListModel::sortHelper(InnerDecklistNode *node, Qt::SortOrder order) const int fromRow = sortResult[i].first; const int toRow = sortResult[i].second; AbstractDecklistNode *temp = node->at(toRow); - for (int j = columnCount(); j; --j) { - from << createIndex(fromRow, 0, temp); - to << createIndex(toRow, 0, temp); + for (int j = 0; j < columnCount(); ++j) { + from << createIndex(fromRow, j, temp); + to << createIndex(toRow, j, temp); } } changePersistentIndexList(from, to);