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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-11-13 22:27:03 +09:00
parent dee1645de0
commit c18464b44f

View file

@ -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);