From 7046c8b34264532b74c667be60ce985b2c9dc147 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 6 Nov 2018 21:48:18 +0100 Subject: Dive list: invert sort-direction to reflect core Traditionally, the DiveTripModel has its data sorted in opposite direction to the core-data (chronologically descending vs. ascending). This bring a number of subtle problems. For example, when filling the model, trips are filled according to the *last* dive, whereas later insertion points are according to the ->when value from the core, which depends on the *first* dive. As a start of fixing these subtleties, change the sort direction to reflect the core-data. Ideally, this should lead to a removal of the redundant data-representation. Since the model is now sorted in ascending order, sorting has to be enabled in the DiveListView constructor to reflect the default-descending order. Signed-off-by: Berthold Stoeger --- desktop-widgets/divelistview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 149682345..c75460c64 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -35,7 +35,7 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec setItemDelegateForColumn(DiveTripModel::RATING, new StarWidgetsDelegate(this)); setModel(MultiFilterSortModel::instance()); - setSortingEnabled(false); + setSortingEnabled(true); setContextMenuPolicy(Qt::DefaultContextMenu); setSelectionMode(ExtendedSelection); header()->setContextMenuPolicy(Qt::ActionsContextMenu); -- cgit v1.2.3-70-g09d2