summaryrefslogtreecommitdiffstats
path: root/qt-models/filtermodels.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-14 14:09:30 -0400
committerGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-14 14:09:30 -0400
commit8a394b9db42a21f684c6ae85005a55c29d060c38 (patch)
treea85c21348cd7dbc416801df09fc028917d1f3c41 /qt-models/filtermodels.h
parentfb47c15cd81970f19aeb9777c4c576b973889674 (diff)
downloadsubsurface-8a394b9db42a21f684c6ae85005a55c29d060c38.tar.gz
Filter: constify doFilter() argument
Conceptually, the doFilter() functions shouldn't modify the dive they test. Therefore, make the argument const. To do this, constify the parameter of get_dive_location(), which likewise seems to be the right thing to do. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/filtermodels.h')
-rw-r--r--qt-models/filtermodels.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/qt-models/filtermodels.h b/qt-models/filtermodels.h
index 2ccfec010..0c35f2612 100644
--- a/qt-models/filtermodels.h
+++ b/qt-models/filtermodels.h
@@ -7,10 +7,12 @@
#include <stdint.h>
#include <vector>
+struct dive;
+
class FilterModelBase : public QStringListModel {
Q_OBJECT
public:
- virtual bool doFilter(struct dive *d) const = 0;
+ virtual bool doFilter(const dive *d) const = 0;
void clearFilter();
void selectAll();
void invertSelection();
@@ -34,7 +36,7 @@ class TagFilterModel : public FilterModelBase {
Q_OBJECT
public:
static TagFilterModel *instance();
- bool doFilter(struct dive *d) const;
+ bool doFilter(const dive *d) const;
public
slots:
void repopulate();
@@ -48,7 +50,7 @@ class BuddyFilterModel : public FilterModelBase {
Q_OBJECT
public:
static BuddyFilterModel *instance();
- bool doFilter(struct dive *d) const;
+ bool doFilter(const dive *d) const;
public
slots:
void repopulate();
@@ -62,7 +64,7 @@ class LocationFilterModel : public FilterModelBase {
Q_OBJECT
public:
static LocationFilterModel *instance();
- bool doFilter(struct dive *d) const;
+ bool doFilter(const dive *d) const;
public
slots:
void repopulate();
@@ -78,7 +80,7 @@ class SuitsFilterModel : public FilterModelBase {
Q_OBJECT
public:
static SuitsFilterModel *instance();
- bool doFilter(struct dive *d) const;
+ bool doFilter(const dive *d) const;
public
slots:
void repopulate();