From 19ca90f1a0ab8bad7488bf03e6248c8a8c8ff7e0 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 11 Nov 2014 13:34:12 -0800 Subject: 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 --- qt-ui/models.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qt-ui/models.h') diff --git a/qt-ui/models.h b/qt-ui/models.h index 470cf5fbc..8a2d3dcb9 100644 --- a/qt-ui/models.h +++ b/qt-ui/models.h @@ -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: -- cgit v1.2.3-70-g09d2