Map: pass down dive site in prepareForGetDiveCoordinates()

Instead of reading out the global object "displayed_dive_site",
pass the dive site to be edited in arguments to
prepareForGetDiveCoordinates() and enter edit mode.

Simplify the code in LocationInformationWidget by not using
signals to call the prepareForGetDiveCoordinates() function.
While doing this, collect common code in accept() and reject()
in the already existing resetState() function.

This is another entry in a series of commits that makes
data-flow more clear by removing access to the global
"displayed_dive_site" object.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-10-08 15:43:06 +02:00 committed by Dirk Hohndel
parent 8091497745
commit dd44dc4ab8
6 changed files with 19 additions and 27 deletions

View file

@ -93,10 +93,10 @@ void MapWidget::endGetDiveCoordinates()
m_mapHelper->exitEditMode();
}
void MapWidget::prepareForGetDiveCoordinates()
void MapWidget::prepareForGetDiveCoordinates(uint32_t uuid)
{
CHECK_IS_READY_RETURN_VOID();
m_mapHelper->enterEditMode();
m_mapHelper->enterEditMode(uuid);
}
void MapWidget::selectedDivesChanged(QList<int> list)