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

Lubomir I. Ivanov neolit123 at gmail.com
Mon Feb 18 13:56:44 PST 2013


On 18 February 2013 20:47, Linus Torvalds <torvalds at linux-foundation.org> wrote:
> On Mon, Feb 18, 2013 at 10:35 AM, Linus Torvalds
> <torvalds at linux-foundation.org> wrote:
>>
>> I'm not understanding why you do thegtk_tree_view_row_expanded on each
>> iteration.
>
> Oh, ok, I see it. You intentionally break the whole "if the trip is
> expanded, just rely on gtk selection", and you want to select the
> dives when you select the trip by hand but not the dives.
>
> And no, we cannot do this. I know we *used* to do it, but it was
> buggy.  When the dives are exposed, we have to let the gtk selection
> just work, because not doing that screws things up.
>
> So right now, if the trip is expanded, and you want to select the
> children, you have to actually do that with the mouse. Exactly because
> of the whole "messing with what gtk already knows about the selection
> doesn't really work".
>
> It's annoying, yes. But the alternative was to have random SIGSEGV's.
>
> You can *possibly* do this by creating a list of the selected trips,
> and after letting the gtk selection work, iterate over that list.
> That's close to what we used to do, but we did it from the "selection
> will change" callback, and that didn't work because you then need to
> wait to use it until after the selection is done, and in the meantime
> there might have been a callback that removed some entry (this was why
> we got SIGSEGV's on OS X - apparently gtk just happens to be robust
> for this on X11, but not with the Quartz backend)
>

oops, completely disregarded that i call it multiple times.
can be optimized to a one time check after the entry point to help the
compiler here.

perhaps we should at least try to select only the first dive, so that
statistics widget isn't broken. we already do that when skipping the
trip row with the "down" key in way.
no idea if this would work for mouse clicks, thought. :\

on the other hand it will end up being inconsistent as we would select
all dives when the trip is collapsed (current master) but only one
dive when the trip is expanded.

lubomir
--


More information about the subsurface mailing list