From 13d922aef7f838c013f1d8eff7771d7b59cf0457 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 31 Jul 2014 14:41:30 -0700 Subject: [PATCH] Keep edited profile after editing a manually added dive This is yet another unintended side effect of the UI restructure changes. I stared at this code for so long - I can't believe I kept missing this. Fixes #668 Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index d57a14b13..0ed6c5dbf 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -664,6 +664,11 @@ void MainTab::acceptChanges() currentTrip = NULL; ui.dateEdit->setEnabled(true); } else { + if (editMode == MANUALLY_ADDED_DIVE) { + // preserve any changes to the profile + free(current_dive->dc.sample); + copy_samples(&displayed_dive.dc, ¤t_dive->dc); + } struct dive *cd = current_dive; //Reset coordinates field, in case it contains garbage. updateGpsCoordinates(&displayed_dive);