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
|
@ -11,6 +11,7 @@
|
|||
#include "core/save-html.h"
|
||||
#include "core/settings/qPrefDisplay.h"
|
||||
#include "core/save-profiledata.h"
|
||||
#include "core/divefilter.h"
|
||||
#include "core/divesite.h"
|
||||
#include "core/errorhelper.h"
|
||||
#include "core/file.h"
|
||||
|
@ -134,10 +135,10 @@ static std::vector<const dive_site *> getDiveSitesToExport(bool selectedOnly)
|
|||
{
|
||||
std::vector<const dive_site *> res;
|
||||
|
||||
if (selectedOnly && MultiFilterSortModel::instance()->diveSiteMode()) {
|
||||
if (selectedOnly && DiveFilter::instance()->diveSiteMode()) {
|
||||
// Special case in dive site mode: export all selected dive sites,
|
||||
// not the dive sites of selected dives.
|
||||
QVector<dive_site *> sites = MultiFilterSortModel::instance()->filteredDiveSites();
|
||||
QVector<dive_site *> sites = DiveFilter::instance()->filteredDiveSites();
|
||||
res.reserve(sites.size());
|
||||
for (const dive_site *ds: sites)
|
||||
res.push_back(ds);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue