From c18464b44f157c9bbea69bb479dc3282237ad3a3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 13 Nov 2013 22:27:03 +0900 Subject: [PATCH] Don't overwrite the new cylinders when adding a dive We carefully assembled the correct data in the cylinders - don't replace that data when manually editing a dive. Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 961686fb9..bd10ed356 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -474,8 +474,7 @@ void MainTab::acceptChanges() if (notesBackup[curr].tags != ui.tagWidget->text()) saveTags(); - - if (cylindersModel->changed) { + if (editMode != ADD && cylindersModel->changed) { mark_divelist_changed(TRUE); Q_FOREACH (dive *d, notesBackup.keys()) { for (int i = 0; i < MAX_CYLINDERS; i++) { @@ -494,6 +493,7 @@ void MainTab::acceptChanges() } } + save_dive(stdout, current_dive); if (editMode == ADD || editMode == MANUALLY_ADDED_DIVE) { // clean up the dive data (get duration, depth information from samples) fixup_dive(current_dive);