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

Miika Turkia miika.turkia at gmail.com
Mon Feb 18 21:06:14 PST 2013

On Tue, Feb 19, 2013 at 6:31 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
> On Feb 18, 2013, at 3:35 PM, Linus Torvalds wrote:
>> 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.
> Done and pushed.
> please test.

I did a quick test with the sample dives.
- Expand the trip
- Select one dive
- Collapse the trip
- Select a dive that is not on a trip
- Expand the trip

Oddities from my point of view:
- There is no visual indication that one or more dives from a trip is
selected when the trip is collapsed
- When selecting a dive without modifiers one expects that other
selections are cleared. This is not the case when dives are selected
in a collapsed trip. This shows on the dive stats and when you expand
the trip.
- Now if I select a trip none of the dives within are selected - no
matter whether the trip is collapsed or expanded (not sure what was
the intended behaviour on this but I thought all the dives would be


More information about the subsurface mailing list