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>
This commit is contained in:
Lubomir I. Ivanov 2017-11-25 23:21:12 +02:00
parent b564debe21
commit 8bc61f42cb

View file

@ -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;
}