Filter: allow filtering multiple dive sites

In the edit-dive-site tab the filter is switched to a particular
mode where only dives at that site are shown.

If we want to reuse this for the dive-site tab the mode has to
be extended to allow for multiple dive sites. This is trivially
done by replacing a pointer by a vector of pointers.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-04-12 15:47:41 +02:00 committed by Dirk Hohndel
parent 5aacd73a00
commit afde4dce0d
3 changed files with 15 additions and 15 deletions

View file

@ -67,8 +67,8 @@ public
slots:
void myInvalidate();
void clearFilter();
void startFilterDiveSite(struct dive_site *ds);
void stopFilterDiveSite();
void startFilterDiveSites(QVector<dive_site *> ds);
void stopFilterDiveSites();
void filterChanged(const QModelIndex &from, const QModelIndex &to, const QVector<int> &roles);
void resetModel(DiveTripModelBase::Layout layout);
void filterDataChanged(const FilterData &data);
@ -80,7 +80,8 @@ signals:
private:
MultiFilterSortModel(QObject *parent = 0);
struct dive_site *curr_dive_site;
// Dive site filtering has priority over other filters
QVector<dive_site *> dive_sites;
void countsChanged();
FilterData filterData;
};