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 /qt-models | |
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 'qt-models')
-rw-r--r-- | qt-models/filtermodels.cpp | 5 | ||||
-rw-r--r-- | qt-models/filtermodels.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index dcb7e69ad..463276e13 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -32,6 +32,11 @@ void MultiFilterSortModel::resetModel(DiveTripModelBase::Layout layout) m->initSelection(); } +void MultiFilterSortModel::clear() +{ + DiveTripModelBase::instance()->clear(); +} + // Translate selection into local indexes and re-emit signal void MultiFilterSortModel::selectionChangedSlot(const QVector<QModelIndex> &indexes) { diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h index 6677c713d..fef39e0d5 100644 --- a/qt-models/filtermodels.h +++ b/qt-models/filtermodels.h @@ -14,6 +14,7 @@ public: bool lessThan(const QModelIndex &, const QModelIndex &) const override; void resetModel(DiveTripModelBase::Layout layout); + void clear(); signals: void selectionChanged(const QVector<QModelIndex> &indexes); void currentDiveChanged(QModelIndex index); |