From 11eaea01dde93cbf76e56afe1dbd65300dd104f5 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Thu, 20 Jul 2017 01:03:04 +0300 Subject: [PATCH] mapwidgethelper.cpp: call deselectMapLocation() in QML If a divesite doesn't have a GPS location we want to deselect the currently selected markers and zoom out the map. In the Map QML object the function deselectMapLocation will handle that. Signed-off-by: Lubomir I. Ivanov --- mobile-widgets/qmlmapwidgethelper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mobile-widgets/qmlmapwidgethelper.cpp b/mobile-widgets/qmlmapwidgethelper.cpp index e0781e7c7..70d165983 100644 --- a/mobile-widgets/qmlmapwidgethelper.cpp +++ b/mobile-widgets/qmlmapwidgethelper.cpp @@ -15,8 +15,10 @@ MapWidgetHelper::MapWidgetHelper(QObject *parent) : QObject(parent) void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds) { - if (!dive_site_has_gps_location(ds)) + if (!dive_site_has_gps_location(ds)) { + QMetaObject::invokeMethod(m_map, "deselectMapLocation"); return; + } MapLocation *location = m_mapLocationModel->getMapLocationForUuid(ds->uuid); QMetaObject::invokeMethod(m_map, "centerOnMapLocation", Q_ARG(QVariant, QVariant::fromValue(location))); }