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
|
@ -7,10 +7,10 @@
|
|||
#include "qmlmapwidgethelper.h"
|
||||
#include "core/divesite.h"
|
||||
#include "core/qthelper.h"
|
||||
#include "core/divefilter.h"
|
||||
#include "qt-models/maplocationmodel.h"
|
||||
#include "qt-models/divelocationmodel.h"
|
||||
#ifndef SUBSURFACE_MOBILE
|
||||
#include "qt-models/filtermodels.h"
|
||||
#include "desktop-widgets/mapwidget.h"
|
||||
#endif
|
||||
|
||||
|
@ -106,7 +106,7 @@ void MapWidgetHelper::updateEditMode()
|
|||
// The filter being set to dive site is the signal that we are in dive site edit mode.
|
||||
// This is the case when either the dive site edit tab or the dive site list tab are active.
|
||||
bool old = m_editMode;
|
||||
m_editMode = MultiFilterSortModel::instance()->diveSiteMode();
|
||||
m_editMode = DiveFilter::instance()->diveSiteMode();
|
||||
if (old != m_editMode)
|
||||
emit editModeChanged();
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue