summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mapwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/mapwidget.cpp')
-rw-r--r--desktop-widgets/mapwidget.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp
index 917b1b2c7..a940cdb39 100644
--- a/desktop-widgets/mapwidget.cpp
+++ b/desktop-widgets/mapwidget.cpp
@@ -50,6 +50,13 @@ void MapWidget::doneLoading(QQuickWidget::Status status)
this, SLOT(coordinatesChangedLocal()));
}
+void MapWidget::centerOnSelectedDiveSite()
+{
+ CHECK_IS_READY_RETURN_VOID();
+ if (!skipReload)
+ m_mapHelper->centerOnSelectedDiveSite();
+}
+
void MapWidget::centerOnDiveSite(struct dive_site *ds)
{
CHECK_IS_READY_RETURN_VOID();
@@ -60,9 +67,9 @@ void MapWidget::centerOnDiveSite(struct dive_site *ds)
void MapWidget::centerOnIndex(const QModelIndex& idx)
{
CHECK_IS_READY_RETURN_VOID();
- struct dive_site *ds = get_dive_site_by_uuid(idx.model()->index(idx.row(), 0).data().toInt());
+ struct dive_site *ds = get_dive_site_by_uuid(idx.model()->index(idx.row(), 0).data().toUInt());
if (!ds || !dive_site_has_gps_location(ds))
- centerOnDiveSite(&displayed_dive_site);
+ centerOnSelectedDiveSite();
else
centerOnDiveSite(ds);
}