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

@ -33,7 +33,7 @@ public slots:
void centerOnIndex(const QModelIndex& idx);
void endGetDiveCoordinates();
void repopulateLabels();
void prepareForGetDiveCoordinates();
void prepareForGetDiveCoordinates(uint32_t uuid);
void selectedDivesChanged(QList<int>);
void coordinatesChangedLocal(degrees_t latitude, degrees_t longitude);
void doneLoading(QQuickWidget::Status status);