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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-12-14 09:20:37 -08:00
parent 27a0f91cff
commit 4b98efb39c

View file

@ -601,6 +601,10 @@ void MainTab::acceptChanges()
mark_divelist_changed(TRUE); mark_divelist_changed(TRUE);
Q_FOREACH (dive *d, notesBackup.keys()) { Q_FOREACH (dive *d, notesBackup.keys()) {
for (int i = 0; i < MAX_CYLINDERS; i++) { for (int i = 0; i < MAX_CYLINDERS; 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]; d->cylinder[i] = multiEditEquipmentPlaceholder.cylinder[i];
} }
} }