From 0afe07d021256de8a68df035496eb520dbc58d82 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 26 Jun 2015 18:25:38 -0700 Subject: Dive site rewrite: make trip location edit work Don't erase the trip information after the user started editing it. Don't act as if a dive was edited - it's trip information we are modifying. Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 3d19fd992..2dbc662b6 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -371,7 +371,6 @@ void MainTab::enableEdition(EditMode newEditMode) if (isTripEdit) { // we are editing trip location and notes displayMessage(tr("This trip is being edited.")); - memset(&displayedTrip, 0, sizeof(displayedTrip)); currentTrip = current_dive->divetrip; ui.dateEdit->setEnabled(false); editMode = TRIP; @@ -933,7 +932,7 @@ void MainTab::acceptChanges() fixup_dive(d); } } - if (current_dive->divetrip) { + if (!editMode == TRIP && current_dive->divetrip) { current_dive->divetrip->when = current_dive->when; find_new_trip_start_time(current_dive->divetrip); } @@ -1320,6 +1319,8 @@ void MainTab::on_location_editingFinished() if (currentTrip) { free(displayedTrip.location); displayedTrip.location = strdup(qPrintable(ui.location->text())); + markChangedWidget(ui.location); + return; } QString currText = ui.location->text(); -- cgit v1.2.3-70-g09d2