mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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:
parent
403206ca06
commit
b6d830f004
1 changed files with 3 additions and 6 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue