1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

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 

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,7 +601,11 @@ 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++) {
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];
} }
} }
} }