mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
After edit the cylinders of a dive copy the full samples
After editing the cylinder table (e.g. deleting a cylinder) and accepting the changes copy the whole dc samples for the dive edited. This is important because the sensor idx in the samples may have changed. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
8212a923b2
commit
07bd8e6455
1 changed files with 3 additions and 0 deletions
|
@ -862,12 +862,15 @@ void MainTab::acceptChanges()
|
|||
cd->cylinder[i].type.description = copy_string(displayed_dive.cylinder[i].type.description);
|
||||
}
|
||||
/* if cylinders changed we may have changed gas change events
|
||||
* and sensor idx in samples as well
|
||||
* - so far this is ONLY supported for a single selected dive */
|
||||
struct divecomputer *tdc = ¤t_dive->dc;
|
||||
struct divecomputer *sdc = &displayed_dive.dc;
|
||||
while(tdc && sdc) {
|
||||
free_events(tdc->events);
|
||||
copy_events(sdc, tdc);
|
||||
free(tdc->sample);
|
||||
copy_samples(sdc, tdc);
|
||||
tdc = tdc->next;
|
||||
sdc = sdc->next;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue