From dd2466f51899aae406dc8c13904787710f30ec1c Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 25 Nov 2017 16:15:57 +0100 Subject: Update filters on refreshDisplay and remember old selecttions Update the filters if the list of dives is updated by calling MultiFilterSortModel::instance()->myInvalidate(); This had the side effect of clearing all selections. Thus, in the repopulate() methods of the FilterModels, check those entries that were checked previously. Since all the filter models use the same code, introduce a base class FilterModelBase. Signed-off-by: Berthold Stoeger --- desktop-widgets/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'desktop-widgets/mainwindow.cpp') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index f685a2b74..b0817b9f1 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -445,7 +445,7 @@ MainWindow *MainWindow::instance() return m_Instance; } -// this gets called after we download dives from a divecomputer +// This gets called after one or more dives were added, edited or downloaded for a dive computer void MainWindow::refreshDisplay(bool doRecreateDiveList) { information()->reload(); @@ -469,6 +469,7 @@ void MainWindow::recreateDiveList() BuddyFilterModel::instance()->repopulate(); LocationFilterModel::instance()->repopulate(); SuitsFilterModel::instance()->repopulate(); + MultiFilterSortModel::instance()->myInvalidate(); } void MainWindow::configureToolbar() { -- cgit v1.2.3-70-g09d2