From ccfea0872d9bc1c3969197f089b2b2a8f03f09fc Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 3 Jan 2015 16:06:00 -0800 Subject: When editing trip data, only copy actual changes We zero out the displayedTrip and only copy changed data into it; so a NULL value is not deleted text, it means there was no change. Fixes #805 Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-ui/maintab.cpp') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 2b23bd5da..efbd3bc20 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -721,11 +721,11 @@ void MainTab::acceptChanges() amount_selected = 1; } else if (MainWindow::instance() && MainWindow::instance()->dive_list()->selectedTrips().count() == 1) { /* now figure out if things have changed */ - if (!same_string(displayedTrip.notes, currentTrip->notes)) { + if (displayedTrip.notes && !same_string(displayedTrip.notes, currentTrip->notes)) { currentTrip->notes = copy_string(displayedTrip.notes); mark_divelist_changed(true); } - if (!same_string(displayedTrip.location, currentTrip->location)) { + if (displayedTrip.location && !same_string(displayedTrip.location, currentTrip->location)) { currentTrip->location = copy_string(displayedTrip.location); mark_divelist_changed(true); } -- cgit v1.2.3-70-g09d2