dirk at hohndel.org
Thu Jan 31 04:53:56 PST 2013
Sergey Starosek <sergey.starosek at gmail.com> writes:
> Steps to reproduce:
> 1. Start with empty datafile
> 2. Create one planned dive which starts in 120 minutes, save it
> 3. Start creating another planned dive which starts in 60 minutes
> (must be earlier then previous one)
> 4. While editting first segment and navigating out of 'Gas used' field
> the first dive disappears from the list
Oh how fun.
We make the somewhat reasonable assumption that the dives in the dive
list have happened in the past and that we are planning a dive in the
future. Therefore we assume that after sorting our planned dive is the
last one in the dive_table.
Of course in your scenario that is no longer the case and while
constructing the second dive (which is now the first in the dive_table)
we suddenly throw away the wrong dive and instead have the new dive
twice in the list and successfully merge the two of them - which of
course makes things go badly when we still look for the pre-merged one.
I think instead of making the code truly generic to work around this
issue the better solution would be to not allow planning of dives out of
order. The dive we plan is required to be the last dive.
Thanks for the report!
More information about the subsurface