diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-12-09 15:13:53 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-10 18:45:30 -0800 |
commit | 358fddd24e03d8f4522b108b28931a1227749831 (patch) | |
tree | c56c32441def8a844428fe2b51fff9330ccd8bbd /core | |
parent | 71307bce42af3070c9f2ff32f52e289cb6c3a64d (diff) | |
download | subsurface-358fddd24e03d8f4522b108b28931a1227749831.tar.gz |
Filter: send filterReset via signal
The old code called directly into the DiveListModel. Instead,
send a signal and hook into the signal from the model. This
will allow us to remove the DiveListModel::instance() function.
This, in turn, is a step towards supporting multiple models
at the same time. However, currently the model manually
sets the hidden_by_filter flag in the core and therefore
only one active model is supported at a time.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r-- | core/divefilter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/divefilter.cpp b/core/divefilter.cpp index 230e8347d..bf9ce1046 100644 --- a/core/divefilter.cpp +++ b/core/divefilter.cpp @@ -193,7 +193,7 @@ void DiveFilter::startFilterDiveSites(QVector<dive_site *> ds) // When switching into dive site mode, reload the dive sites. // We won't do this in myInvalidate() once we are in dive site mode. MapWidget::instance()->reload(); - DiveTripModelBase::instance()->recalculateFilter(); + emit diveListNotifier.filterReset(); } } @@ -202,7 +202,7 @@ void DiveFilter::stopFilterDiveSites() if (--diveSiteRefCount > 0) return; dive_sites.clear(); - DiveTripModelBase::instance()->recalculateFilter(); + emit diveListNotifier.filterReset(); MapWidget::instance()->reload(); } @@ -215,7 +215,7 @@ void DiveFilter::setFilterDiveSite(QVector<dive_site *> ds) return; dive_sites = ds; - DiveTripModelBase::instance()->recalculateFilter(); + emit diveListNotifier.filterReset(); MapWidget::instance()->setSelected(dive_sites); MainWindow::instance()->diveList->expandAll(); } @@ -233,6 +233,6 @@ bool DiveFilter::diveSiteMode() const void DiveFilter::setFilter(const FilterData &data) { filterData = data; - DiveTripModelBase::instance()->recalculateFilter(); + emit diveListNotifier.filterReset(); } #endif // SUBSURFACE_MOBILE |