mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
80fe8fb331
commit
ec586d0e0a
2 changed files with 51 additions and 34 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue