summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/divelistview.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-29 15:14:29 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-01 07:28:15 -0700
commit6fb3a499e67bc5375e66faef5969afee99a74d25 (patch)
treecc25c2b9b68efb2ae6822902038e23ad3b13b0d5 /desktop-widgets/divelistview.cpp
parentade0d8e758bd925f919d172c0293eb160502e0fd (diff)
downloadsubsurface-6fb3a499e67bc5375e66faef5969afee99a74d25.tar.gz
Dive list: remove forceSort parameter from DiveListView::reload()
DiveListView::reload() was called for full reset of the dive list and for changing the view (tree vs. lis) in DiveListView::headerClicked(). Since the latter does sorting by itself, a parameter "forceSort" was introduced, which defaulted to true, but was set to false by DiveListView::headerClicked(). To remove complexity, simply let DiveListView::headerClicked() set the view by itself and remove tha parameter. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/divelistview.cpp')
-rw-r--r--desktop-widgets/divelistview.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp
index 9c5ea8b1c..b669eb077 100644
--- a/desktop-widgets/divelistview.cpp
+++ b/desktop-widgets/divelistview.cpp
@@ -479,8 +479,9 @@ void DiveListView::headerClicked(int i)
unselectDives();
if (currentLayout == DiveTripModel::TREE)
backupExpandedRows();
- reload(newLayout, false);
+ currentLayout = newLayout;
currentOrder = Qt::DescendingOrder;
+ MultiFilterSortModel::instance()->setLayout(newLayout);
sortByColumn(i, currentOrder);
if (newLayout == DiveTripModel::TREE)
restoreExpandedRows();
@@ -490,7 +491,7 @@ void DiveListView::headerClicked(int i)
sortColumn = i;
}
-void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
+void DiveListView::reload(DiveTripModel::Layout layout)
{
if (layout == DiveTripModel::CURRENT)
layout = currentLayout;
@@ -499,9 +500,6 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
MultiFilterSortModel::instance()->setLayout(layout);
- if (!forceSort)
- return;
-
sortByColumn(sortColumn, currentOrder);
if (amount_selected && current_dive != NULL)
selectDive(get_divenr(current_dive), true);