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>
This commit is contained in:
parent
250fc1e03f
commit
11eaea01dd
@ -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)));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user