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>
This commit is contained in:
Dirk Hohndel 2015-01-19 17:33:45 +12:00
parent df46b85ee1
commit 803d390044

View file

@ -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);