diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-01-19 17:33:45 +1200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-19 17:39:31 +1200 |
commit | 803d390044fe17597c914119a1e0b5411d8d92ff (patch) | |
tree | a93b96d705000bdc2a82eedd320d0d9c88ea80be | |
parent | df46b85ee1cc7a33fe35e69c19345a59c966fa41 (diff) | |
download | subsurface-803d390044fe17597c914119a1e0b5411d8d92ff.tar.gz |
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 <dirk@hohndel.org>
-rw-r--r-- | qt-ui/globe.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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<QString, GeoDataPlacemark *> 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); |