From 803d390044fe17597c914119a1e0b5411d8d92ff Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 19 Jan 2015 17:33:45 +1200 Subject: Show a flag when editing a location on the globe Since we don't modify the dive list, the new flag wouldn't show up until we accepted the change - that's not user friendly. Signed-off-by: Dirk Hohndel --- qt-ui/globe.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index d8beff91d..2403758c4 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -187,9 +187,13 @@ void GlobeGPS::repopulateLabels() loadedDives = new GeoDataDocument; QMap locationMap; - int idx = 0; + int idx = -2; struct dive *dive; - for_each_dive (idx, dive) { + // normally we use for_each_dive (idx, dive) to loop over all dives, + // but we need to include the displayed_dive while things are + // edited, so let's hand roll this loop + while (++idx < dive_table.nr) { + dive = (idx == -1 ? &displayed_dive : get_dive(idx)); if (dive_has_gps_location(dive)) { GeoDataPlacemark *place = new GeoDataPlacemark(dive->location); place->setCoordinate(dive->longitude.udeg / 1000000.0, dive->latitude.udeg / 1000000.0, 0, GeoDataCoordinates::Degree); -- cgit v1.2.3-70-g09d2