summaryrefslogtreecommitdiffstats
path: root/qt-models/filtermodels.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-27 11:49:16 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-28 05:03:59 -0700
commitec586d0e0a19cb7af62506fc2a3cb2f53198bcb8 (patch)
tree90d2b7db6913c1af19b6fe11c6c85d438ce9124a /qt-models/filtermodels.h
parent80fe8fb331edd494ba53efb0879eb9d53031216e (diff)
downloadsubsurface-ec586d0e0a19cb7af62506fc2a3cb2f53198bcb8.tar.gz
Filter: replace checked-state by struct
In the future, we might be smarter about the dive-counts and calculate them only once and incrementally (if e.g. new dives are added). Prepare for more complex caching by turning the checked boolean into a struct, which can then be extended by a count and other things (e.g. the name). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/filtermodels.h')
-rw-r--r--qt-models/filtermodels.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h
index bcbbf000a..8bac44680 100644
--- a/qt-models/filtermodels.h
+++ b/qt-models/filtermodels.h
@@ -11,12 +11,16 @@ struct dive;
class FilterModelBase : public QStringListModel {
Q_OBJECT
+protected:
+ struct Item {
+ bool checked;
+ };
+ std::vector<Item> items;
public:
virtual bool doFilter(const dive *d) const = 0;
void clearFilter();
void selectAll();
void invertSelection();
- std::vector<char> checkState;
bool anyChecked;
bool negate;
public