summaryrefslogtreecommitdiffstats
path: root/qt-models/divelocationmodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/divelocationmodel.h')
-rw-r--r--qt-models/divelocationmodel.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/qt-models/divelocationmodel.h b/qt-models/divelocationmodel.h
index 65fabca96..f2bcc7cf7 100644
--- a/qt-models/divelocationmodel.h
+++ b/qt-models/divelocationmodel.h
@@ -32,12 +32,19 @@ public:
public slots:
void update();
- QStringList allSiteNames() const;
void diveSiteDiveCountChanged(struct dive_site *ds);
void diveSiteAdded(struct dive_site *ds, int idx);
void diveSiteDeleted(struct dive_site *ds, int idx);
+};
+
+class DiveSiteSortedModel : public QSortFilterProxyModel {
+ Q_OBJECT
private:
- QStringList locationNames;
+ bool filterAcceptsRow(int sourceRow, const QModelIndex &source_parent) const override;
+ bool lessThan(const QModelIndex &i1, const QModelIndex &i2) const override;
+public:
+ DiveSiteSortedModel();
+ QStringList allSiteNames() const;
};
// To access only divesites at the given GPS coordinates with the exception of a given dive site