Selection: don't reset selection when resorting

The old code saved, cleared and restored the selection. This
is not necessary anymore, because on model reset the selection,
which is stored in the core, is reset. Remove the unnecessary
selection handling.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-11-28 15:38:36 +01:00 committed by bstoeger
parent 55ffd5d1b5
commit a83bc5ecdb

View file

@ -480,8 +480,6 @@ void DiveListView::sortIndicatorChanged(int i, Qt::SortOrder order)
sortByColumn(i, order); sortByColumn(i, order);
} else { } else {
// clear the model, repopulate with new indexes. // clear the model, repopulate with new indexes.
rememberSelection();
unselectDives();
if (currentLayout == DiveTripModelBase::TREE) if (currentLayout == DiveTripModelBase::TREE)
backupExpandedRows(); backupExpandedRows();
currentLayout = newLayout; currentLayout = newLayout;
@ -489,7 +487,6 @@ void DiveListView::sortIndicatorChanged(int i, Qt::SortOrder order)
sortByColumn(i, order); sortByColumn(i, order);
if (newLayout == DiveTripModelBase::TREE) if (newLayout == DiveTripModelBase::TREE)
restoreExpandedRows(); restoreExpandedRows();
restoreSelection();
} }
} }