summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-11-06 21:48:18 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-16 16:57:14 -0800
commit7046c8b34264532b74c667be60ce985b2c9dc147 (patch)
tree031b848dd3ce2b2dc1a26cf5c1938ea74fdaf0b3 /desktop-widgets
parent1aef22116c0f0d4a6675225ab1b896715f3e9212 (diff)
downloadsubsurface-7046c8b34264532b74c667be60ce985b2c9dc147.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/divelistview.cpp2
1 files changed, 1 insertions, 1 deletions
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);