diff options
-rw-r--r-- | qt-models/divelocationmodel.cpp | 10 | ||||
-rw-r--r-- | qt-models/divelocationmodel.h | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/qt-models/divelocationmodel.cpp b/qt-models/divelocationmodel.cpp index fca322dcf..abdf69f91 100644 --- a/qt-models/divelocationmodel.cpp +++ b/qt-models/divelocationmodel.cpp @@ -183,3 +183,13 @@ GeoReferencingOptionsModel::GeoReferencingOptionsModel(QObject *parent) : QStrin list << taxonomy_category_names[i]; setStringList(list); } + +bool filter_same_gps_cb (QAbstractItemModel *model, int sourceRow, const QModelIndex& parent) +{ + int ref_lat = displayed_dive_site.latitude.udeg; + int ref_lon = displayed_dive_site.longitude.udeg; + QModelIndex curr = model->index(sourceRow, LocationInformationModel::UUID, parent.isValid() ? parent : QModelIndex()); + + struct dive_site *ds = get_dive_site_by_uuid(curr.data().toInt()); + return (ds->latitude.udeg == ref_lat && ds->longitude.udeg == ref_lon); +}
\ No newline at end of file diff --git a/qt-models/divelocationmodel.h b/qt-models/divelocationmodel.h index 3bf7161f5..f40bbd1de 100644 --- a/qt-models/divelocationmodel.h +++ b/qt-models/divelocationmodel.h @@ -5,10 +5,14 @@ #include <QStringListModel> #include <stdint.h> +#include "ssrfsortfilterproxymodel.h" + class QLineEdit; #define RECENTLY_ADDED_DIVESITE 1 +bool filter_same_gps_cb (int sourceRow, const QModelIndex& parent); + class LocationInformationModel : public QAbstractTableModel { Q_OBJECT public: |