From dd44dc4ab8fb888dcb3046ae5ecca2b24fe9e44f Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 8 Oct 2018 15:43:06 +0200 Subject: 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 --- desktop-widgets/mapwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'desktop-widgets/mapwidget.cpp') diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp index ca519b774..471e924a6 100644 --- a/desktop-widgets/mapwidget.cpp +++ b/desktop-widgets/mapwidget.cpp @@ -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 list) -- cgit v1.2.3-70-g09d2