diff options
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/divelistview.cpp | 8 | ||||
-rw-r--r-- | desktop-widgets/divelistview.h | 2 | ||||
-rw-r--r-- | desktop-widgets/tab-widgets/maintab.cpp | 2 |
3 files changed, 5 insertions, 7 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); diff --git a/desktop-widgets/divelistview.h b/desktop-widgets/divelistview.h index c53e2aa01..44d6fdc24 100644 --- a/desktop-widgets/divelistview.h +++ b/desktop-widgets/divelistview.h @@ -25,7 +25,7 @@ public: void mouseDoubleClickEvent(QMouseEvent * event); void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected); void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); - void reload(DiveTripModel::Layout layout, bool forceSort = true); + void reload(DiveTripModel::Layout layout); bool eventFilter(QObject *, QEvent *); void unselectDives(); void clearTripSelection(); diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index 102570174..d27a4730d 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -926,7 +926,7 @@ void MainTab::acceptChanges() int scrolledBy = MainWindow::instance()->diveList->verticalScrollBar()->sliderPosition(); resetPallete(); if (editMode == MANUALLY_ADDED_DIVE) { - MainWindow::instance()->diveList->reload(DiveTripModel::CURRENT, true); + MainWindow::instance()->diveList->reload(DiveTripModel::CURRENT); int newDiveNr = get_divenr(get_dive_by_uniq_id(addedId)); MainWindow::instance()->diveList->unselectDives(); MainWindow::instance()->diveList->selectDive(newDiveNr, true); |