From 3003c6e1eed330978193d6859eca2f79ee68aa54 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 17 Nov 2019 19:53:18 +0100 Subject: Filter: move recalculation of filter from FilterModel to TripModel The way this was accessed via Qt's model semantics was horrible. This gives arguably more readable code, since we don't have to shoehorn things through QVariants. Signed-off-by: Berthold Stoeger --- desktop-widgets/divelistview.cpp | 2 +- desktop-widgets/mainwindow.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index d6a4d507e..860e3bc95 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -47,7 +47,7 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec resetModel(); // Update selection if all selected dives were hidden by filter - connect(MultiFilterSortModel::instance(), &MultiFilterSortModel::filterFinished, this, &DiveListView::filterFinished); + connect(&diveListNotifier, &DiveListNotifier::filterReset, this, &DiveListView::filterFinished); connect(&diveListNotifier, &DiveListNotifier::tripChanged, this, &DiveListView::tripChanged); diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 41369f8ec..676fbce87 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -423,7 +423,7 @@ void MainWindow::refreshDisplay(bool doRecreateDiveList) void MainWindow::recreateDiveList() { diveList->reload(); - MultiFilterSortModel::instance()->myInvalidate(); + DiveTripModelBase::instance()->recalculateFilter(); } void MainWindow::configureToolbar() -- cgit v1.2.3-70-g09d2