mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Map: pass changed coordinates via signal
The coordinates of a "dragged flag" were passed out-of-bound via the global "displayed_dive_site" object and then a signal was sent to notify of the changed coordinates. Instead, pass the coordinates directly via the signal. This makes the data- and control-flow more clear. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
66c5c5f72b
commit
754160d625
6 changed files with 14 additions and 16 deletions
|
@ -272,9 +272,8 @@ void MapWidgetHelper::updateCurrentDiveSiteCoordinatesFromMap(quint32 uuid, QGeo
|
|||
MapLocation *loc = m_mapLocationModel->getMapLocationForUuid(uuid);
|
||||
if (loc)
|
||||
loc->setCoordinate(coord);
|
||||
displayed_dive_site.latitude.udeg = lrint(coord.latitude() * 1000000.0);
|
||||
displayed_dive_site.longitude.udeg = lrint(coord.longitude() * 1000000.0);
|
||||
emit coordinatesChanged();
|
||||
emit coordinatesChanged(degrees_t { (int)lrint(coord.latitude() * 1000000.0) },
|
||||
degrees_t { (int)lrint(coord.longitude() * 1000000.0) });
|
||||
}
|
||||
|
||||
void MapWidgetHelper::updateDiveSiteCoordinates(uint32_t uuid, degrees_t latitude, degrees_t longitude)
|
||||
|
@ -305,9 +304,8 @@ void MapWidgetHelper::setEditMode(bool editMode)
|
|||
} else {
|
||||
coord = exists->coordinate();
|
||||
}
|
||||
displayed_dive_site.latitude.udeg = lrint(coord.latitude() * 1000000.0);
|
||||
displayed_dive_site.longitude.udeg = lrint(coord.longitude() * 1000000.0);
|
||||
emit coordinatesChanged();
|
||||
emit coordinatesChanged(degrees_t { (int)lrint(coord.latitude() * 1000000.0) },
|
||||
degrees_t { (int)lrint(coord.longitude() * 1000000.0) });
|
||||
}
|
||||
emit editModeChanged();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue