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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2017-11-25 16:15:57 +01:00 committed by Dirk Hohndel
parent 4da6a0a732
commit dd2466f518
3 changed files with 53 additions and 25 deletions

View file

@ -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() {