mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
undo: renumber cylinders when deleting a cylinder
Removal of a cylinder requires a renumbering of cylinders in the core data structures (samples, etc.). The renumbering was performed in the undo-action of cylinder removal, but not during actual cylinder removal. What a mess! Add the missing call. Attention: this makes the deletion of sensor-readings on cylinder-deletion non-undoable! Undo will have to be fixed in upcoming commits. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
9376721873
commit
64faa23448
1 changed files with 1 additions and 0 deletions
|
@ -1177,6 +1177,7 @@ void RemoveCylinder::undo()
|
|||
for (size_t i = 0; i < dives.size(); ++i) {
|
||||
std::vector<int> mapping = get_cylinder_map_for_add(dives[i]->cylinders.nr, indexes[i]);
|
||||
add_cylinder(&dives[i]->cylinders, indexes[i], clone_cylinder(cyl[i]));
|
||||
cylinder_renumber(dives[i], &mapping[0]);
|
||||
update_cylinder_related_info(dives[i]);
|
||||
emit diveListNotifier.cylinderAdded(dives[i], indexes[i]);
|
||||
invalidate_dive_cache(dives[i]); // Ensure that dive is written in git_save()
|
||||
|
|
Loading…
Reference in a new issue