diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-25 23:21:12 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-27 22:59:22 +0100 |
commit | 8bc61f42cb24d0360d7ebb4a588ec8d6e7d6c95e (patch) | |
tree | c32e47347fade1e878231400a14d81c829475c10 /map-widget | |
parent | b564debe211d6e046e4265414efe1ddf8ffda861 (diff) | |
download | subsurface-8bc61f42cb24d0360d7ebb4a588ec8d6e7d6c95e.tar.gz |
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 <neolit123@gmail.com>
Diffstat (limited to 'map-widget')
-rw-r--r-- | map-widget/qmlmapwidgethelper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<QGeoCoordinate>(existingLocation->getRole(MapLocation::Roles::RoleCoordinate)); + QGeoCoordinate coord = existingLocation->coordinate(); if (dsCoord.distanceTo(coord) < MIN_DISTANCE_BETWEEN_DIVE_SITES_M) continue; } |