diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-12-09 15:22:02 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-10 18:45:30 -0800 |
commit | e7dafe36aabfe45a4a0b8d6b8056fa9e4d03aaf4 (patch) | |
tree | f04b708b08d8e700e9286af2d8a951420c3676b1 /desktop-widgets/mainwindow.cpp | |
parent | 358fddd24e03d8f4522b108b28931a1227749831 (diff) | |
download | subsurface-e7dafe36aabfe45a4a0b8d6b8056fa9e4d03aaf4.tar.gz |
Dive list: clear dive data via the filter model
The UI talks to the filter model. Therefore route clearing of
data through that model instead of accessing the source model
directly.
This will allow us to remove the DiveTripModel::instance()
function and makes control flow less "jumpy".
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index b8baac371..3a92656ad 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -69,6 +69,7 @@ #include "qt-models/cylindermodel.h" #include "qt-models/divepicturemodel.h" #include "qt-models/diveplannermodel.h" +#include "qt-models/filtermodels.h" #include "qt-models/tankinfomodel.h" #include "qt-models/weightsysteminfomodel.h" #include "qt-models/yearlystatisticsmodel.h" @@ -650,7 +651,7 @@ void MainWindow::closeCurrentFile() { /* free the dives and trips */ clear_git_id(); - DiveTripModelBase::instance()->clear(); + MultiFilterSortModel::instance()->clear(); setCurrentFile(nullptr); diveList->setSortOrder(DiveTripModelBase::NR, Qt::DescendingOrder); MapWidget::instance()->reload(); |