mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Filter: split out filter from model
Split out the actual filtering from the MultiFilterSortModel. Create a DiveFilter class that does the actual filtering. Currently, mobile and desktop have their own version of this class, though ultimately we may want to merge them. The idea here is that the trip-model and undo-commands have direct access to the filter-function and thus can take care of keeping track of the number of shown dives, etc. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
6d6d10f03a
commit
b76f207158
16 changed files with 369 additions and 308 deletions
|
@ -2,6 +2,7 @@
|
|||
#include "maplocationmodel.h"
|
||||
#include "divelocationmodel.h"
|
||||
#include "core/divesite.h"
|
||||
#include "core/divefilter.h"
|
||||
#ifndef SUBSURFACE_MOBILE
|
||||
#include "qt-models/filtermodels.h"
|
||||
#include "desktop-widgets/mapwidget.h"
|
||||
|
@ -133,9 +134,9 @@ void MapLocationModel::reload(QObject *map)
|
|||
// the dive site tab), we want to show all dive sites, not only those
|
||||
// of the non-hidden dives. Moreover, the selected dive sites are those
|
||||
// that we filter for.
|
||||
bool diveSiteMode = MultiFilterSortModel::instance()->diveSiteMode();
|
||||
bool diveSiteMode = DiveFilter::instance()->diveSiteMode();
|
||||
if (diveSiteMode)
|
||||
m_selectedDs = MultiFilterSortModel::instance()->filteredDiveSites();
|
||||
m_selectedDs = DiveFilter::instance()->filteredDiveSites();
|
||||
#endif
|
||||
for (int i = 0; i < dive_site_table.nr; ++i) {
|
||||
struct dive_site *ds = dive_site_table.dive_sites[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue