From 754160d625d374cc2b98df53511371b0ab286c7a Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 8 Oct 2018 13:51:57 +0200 Subject: 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 --- desktop-widgets/locationinformation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'desktop-widgets/locationinformation.cpp') diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp index 28a33ba2e..5fc1eb4d0 100644 --- a/desktop-widgets/locationinformation.cpp +++ b/desktop-widgets/locationinformation.cpp @@ -141,10 +141,10 @@ void LocationInformationWidget::clearLabels() ui.locationTags->clear(); } -void LocationInformationWidget::updateGpsCoordinates() +void LocationInformationWidget::updateGpsCoordinates(degrees_t latitude, degrees_t longitude) { QString oldText = ui.diveSiteCoordinates->text(); - const char *coords = printGPSCoords(displayed_dive_site.latitude.udeg, displayed_dive_site.longitude.udeg); + const char *coords = printGPSCoords(latitude.udeg, longitude.udeg); ui.diveSiteCoordinates->setText(coords); enableLocationButtons(dive_site_has_gps_location(&displayed_dive_site)); free((void *)coords); -- cgit v1.2.3-70-g09d2