mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Embed the information whether a dive is hidden by a filter in the dive
This way other parts of the code can act on the "hidden_by_filter" state. This also cleans up the way we track if a dive is hidden - do it in the multi filter instead of the individual filters. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d5ffc16c36
commit
19ca90f1a0
3 changed files with 70 additions and 47 deletions
|
@ -442,6 +442,7 @@ class MultiFilterInterface {
|
|||
public:
|
||||
MultiFilterInterface() : checkState(NULL){};
|
||||
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const = 0;
|
||||
virtual bool doFilter(struct dive *d, QModelIndex &index0, QAbstractItemModel *sourceModel) const = 0;
|
||||
virtual void clearFilter() = 0;
|
||||
bool *checkState;
|
||||
bool anyChecked;
|
||||
|
@ -455,6 +456,7 @@ public:
|
|||
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const;
|
||||
bool doFilter(struct dive *d, QModelIndex &index0, QAbstractItemModel *sourceModel) const;
|
||||
void clearFilter();
|
||||
public
|
||||
slots:
|
||||
|
@ -472,6 +474,7 @@ public:
|
|||
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const;
|
||||
bool doFilter(struct dive *d, QModelIndex &index0, QAbstractItemModel *sourceModel) const;
|
||||
void clearFilter();
|
||||
public
|
||||
slots:
|
||||
|
@ -489,6 +492,7 @@ public:
|
|||
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
|
||||
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
virtual bool filterRow(int source_row, const QModelIndex &source_parent, QAbstractItemModel *sourceModel) const;
|
||||
bool doFilter(struct dive *d, QModelIndex &index0, QAbstractItemModel *sourceModel) const;
|
||||
void clearFilter();
|
||||
public
|
||||
slots:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue