diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-05-03 22:49:39 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-05-11 12:06:19 -0700 |
commit | b6d830f0047cf0f68d9f7564f02c6b527f5051a0 (patch) | |
tree | f43d4b0581be2ce60718460cd0da341d6fcf9c1e /map-widget | |
parent | 403206ca06cf87d64b75cafa8629956ea7cf282b (diff) | |
download | subsurface-b6d830f0047cf0f68d9f7564f02c6b527f5051a0.tar.gz |
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>
Diffstat (limited to 'map-widget')
-rw-r--r-- | map-widget/qmlmapwidgethelper.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/map-widget/qmlmapwidgethelper.cpp b/map-widget/qmlmapwidgethelper.cpp index e4c62ccd0..1e8199adf 100644 --- a/map-widget/qmlmapwidgethelper.cpp +++ b/map-widget/qmlmapwidgethelper.cpp @@ -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) - : m_map->property("center").value<QGeoCoordinate>(); + 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(); |