Dive edit: do a better job noticing when the coordinates were changed

Previously the code could get confused by edits (including trivial things
like deleting the coordinates). It seems much more reliable to simply
compare the coordinates of the edited dive with the ones in the current
dive before the edits.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-06-09 10:55:56 -07:00
parent a26719c541
commit 95cb4e85ee

View file

@ -663,7 +663,8 @@ void MainTab::acceptChanges()
}
}
}
if (ui.coordinates->isModified()) {
if (editedDive.latitude.udeg != current_dive->latitude.udeg ||
editedDive.longitude.udeg != current_dive->longitude.udeg) {
EDIT_SELECTED_DIVES(gpsHasChanged(mydive, cd, ui.coordinates->text(), 0));
}
if (tagsChanged(&editedDive, cd))