From ec586d0e0a19cb7af62506fc2a3cb2f53198bcb8 Mon Sep 17 00:00:00 2001
From: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Date: Mon, 27 Aug 2018 11:49:16 +0200
Subject: 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>
---
 qt-models/filtermodels.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'qt-models/filtermodels.h')

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
-- 
cgit v1.2.3-70-g09d2