From 8bc61f42cb24d0360d7ebb4a588ec8d6e7d6c95e Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 25 Nov 2017 23:21:12 +0200 Subject: [PATCH] map-widget: use 'getter' function coordinate() for MapLocation Avoid using qvariant_cast() with getRole() in favor of MapLocation::coordinate() in MapWidgetHelper::reloadMapLocations(). This makes the code more readble. Signed-off-by: Lubomir I. Ivanov --- map-widget/qmlmapwidgethelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map-widget/qmlmapwidgethelper.cpp b/map-widget/qmlmapwidgethelper.cpp index d9d6312a7..c652520bc 100644 --- a/map-widget/qmlmapwidgethelper.cpp +++ b/map-widget/qmlmapwidgethelper.cpp @@ -115,7 +115,7 @@ void MapWidgetHelper::reloadMapLocations() // at least MIN_DISTANCE_BETWEEN_DIVE_SITES_M apart if (locationNameMap.contains(name)) { MapLocation *existingLocation = locationNameMap[name]; - QGeoCoordinate coord = qvariant_cast(existingLocation->getRole(MapLocation::Roles::RoleCoordinate)); + QGeoCoordinate coord = existingLocation->coordinate(); if (dsCoord.distanceTo(coord) < MIN_DISTANCE_BETWEEN_DIVE_SITES_M) continue; }