aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-20 01:03:04 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commit11eaea01dde93cbf76e56afe1dbd65300dd104f5 (patch)
treea882bc746ef487dd5ca79057b61d38a12c732646 /mobile-widgets
parent250fc1e03fea00a1a7e14555f652e713fdb38ede (diff)
downloadsubsurface-11eaea01dde93cbf76e56afe1dbd65300dd104f5.tar.gz
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 <neolit123@gmail.com>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmapwidgethelper.cpp4
1 files changed, 3 insertions, 1 deletions
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)));
}