From 4b98efb39c0bbcfe21c635bbb8e529710bdf70cd Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 14 Dec 2013 09:20:37 -0800 Subject: [PATCH] When editing multiple dives, only copy the cylinder type Previously we would overwrite the gasmix as well as start and end pressure even when editing multiple dives, which clearly is wrong. Fixes #364 Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 81187dcf8..82e5d2ee5 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -601,7 +601,11 @@ void MainTab::acceptChanges() mark_divelist_changed(TRUE); Q_FOREACH (dive *d, notesBackup.keys()) { for (int i = 0; i < MAX_CYLINDERS; i++) { - d->cylinder[i] = multiEditEquipmentPlaceholder.cylinder[i]; + if (notesBackup.keys().count() > 1) + // only copy the cylinder type, none of the other values + d->cylinder[i].type = multiEditEquipmentPlaceholder.cylinder[i].type; + else + d->cylinder[i] = multiEditEquipmentPlaceholder.cylinder[i]; } } }