From 95cb4e85ee4ccf1fe6672e82eacd423c6720c201 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 9 Jun 2014 10:55:56 -0700 Subject: [PATCH] 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 --- qt-ui/maintab.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 442136d7f..c0fdeca6e 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -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))