[PATCH] Select all dives in a trip when said trip is expanded and clicked

Linus Torvalds torvalds at linux-foundation.org
Mon Feb 18 15:35:32 PST 2013


On Mon, Feb 18, 2013 at 2:46 PM, Linus Torvalds
<torvalds at linux-foundation.org> wrote:
>
> No, not only does the selected_dive go away, we also have zero selected dives.
>
> It's just the statistics window that doesn't update. There's probably
> some logic along the lines of "nothing selected, so don't bother
> updating the statistics". So the "Stats" notebook keeps showing the
> old selection state.

Ok, the cause for that is that "update_dive()" only does the
"show_dive_stats(new_dive);" thing if "new_dive" is non-NULL.

So any time there is no current dive, we stop updating statistics, and
show the old stats.

If somebody wants to fix it, you'll need to make show_dive_stats()
able to handle a NULL dive, and then call it unconditionally, the same
way we call show_dive_info() unconditionally whether we have a dive or
not.

I do have a very hacky thing to make "select just the dive trip" work
the way you'd expect it. I'll send that as a separate email.

                  Linus


More information about the subsurface mailing list