Map: remove dead code

When entering map-edit mode and the dive site existed, its
coordinates were extracted but never used. Remove that useless
if-branch.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-05-03 22:49:39 +02:00 committed by Dirk Hohndel
parent 403206ca06
commit b6d830f004

View file

@ -241,16 +241,13 @@ void MapWidgetHelper::enterEditMode(struct dive_site *ds)
return;
m_editMode = true;
MapLocation *exists = m_mapLocationModel->getMapLocation(ds);
QGeoCoordinate coord;
// if divesite doesn't exist in the model, add a new MapLocation.
MapLocation *exists = m_mapLocationModel->getMapLocation(ds);
if (!exists) {
// If the dive site doesn't have a GPS location, use the centre of the map
coord = has_location(&ds->location) ? getCoordinates(ds)
QGeoCoordinate coord = has_location(&ds->location) ? getCoordinates(ds)
: m_map->property("center").value<QGeoCoordinate>();
m_mapLocationModel->add(new MapLocation(ds, coord, QString(ds->name)));
} else {
coord = exists->coordinate();
}
centerOnDiveSite(ds);
emit editModeChanged();