From d29f82c52d604ddf65476bf382d4bbf1b5634525 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 3 May 2019 23:16:40 +0200 Subject: Map: make edit mode depend on dive-site-filtering Since the dive-site-filter is active either on the dive-site-edit page or the dive-site-list page, use that as the flag for dive-site-edit mode. Moreover, when the filter is reset, the MapWidgetHelper::reloadMapLocations() function is called, so we can use that place to enter/exit edit mode. This makes it easier to keep everything consistent. Signed-off-by: Berthold Stoeger --- qt-models/maplocationmodel.cpp | 5 +++++ qt-models/maplocationmodel.h | 1 + 2 files changed, 6 insertions(+) (limited to 'qt-models') diff --git a/qt-models/maplocationmodel.cpp b/qt-models/maplocationmodel.cpp index 90d7209f7..1e0fd9c81 100644 --- a/qt-models/maplocationmodel.cpp +++ b/qt-models/maplocationmodel.cpp @@ -110,6 +110,11 @@ void MapLocationModel::add(MapLocation *location) endInsertRows(); } +const QVector &MapLocationModel::selectedDs() const +{ + return m_selectedDs; +} + void MapLocationModel::reload() { int idx; diff --git a/qt-models/maplocationmodel.h b/qt-models/maplocationmodel.h index 6f075cc84..b1b13896a 100644 --- a/qt-models/maplocationmodel.h +++ b/qt-models/maplocationmodel.h @@ -62,6 +62,7 @@ public: void add(MapLocation *); void reload(); MapLocation *getMapLocation(const struct dive_site *ds); + const QVector &selectedDs() const; void updateMapLocationCoordinates(const struct dive_site *ds, QGeoCoordinate coord); Q_INVOKABLE void setSelected(struct dive_site *ds, bool fromClick = true); // The dive site is passed as a QVariant, because a null-QVariant is not automatically -- cgit v1.2.3-70-g09d2