pull request

Linus Torvalds torvalds at linux-foundation.org
Mon Aug 20 06:56:35 PDT 2012


On Sun, Aug 19, 2012 at 8:03 PM, Dirk Hohndel <dirk at hohndel.org> wrote:
>
> On Aug 19, 2012, at 5:48 PM, Linus Torvalds wrote:
>>
>> Ok, I have something that approaches being usable, but won't get
>> around to finishing it today.
>
> Sadly you didn't push it anywhere I could find it…

It wasn't ready enough. But I have jetlag, woke up early, and finished it.

Well, "finished" may be the wrong word, but it's pushed out and works.
It gets a lot of cases right, and the code is actually smaller and, I
think, easier to understand.

The whole "is the group heading selected after you do certain
operations" things is ambiguous as mentioned, but I tried to choose
reasonably sane choices.

So you can - for example - do something like this:

 - in the expanded date view, select a range of dives that crosses
dive groups, and does *not* select the full groups at the beginning
and end

 - collapse and re-expand everything, and the selection shouldn't change.

 - sort by something else, and go back to the date view, and the
selection shouldn't change.

 - collapse, and select some other dives, and the selection should do
the right thing, regardless of whether you do a whole new selection,
or whether you start adding to the old one with ctrl-click.

What does *not* necessarily always work sanely is the "range
selection" when you have expanded groups, and the beginning or the end
of the range is the group entry. It seems that gtks range-select logic
gets confused by the fact that we selected some dives "behind its
back" (although we obviously did tell gtk that we selected them by
explicitly doing the "gtk_tree_selection_select_iter()" thing), and
the range selection logic ends up doing sometimes odd things.

That said, range selection works fine for ranges of actual dives, or
ranges of collapsed dive groups. It's only with expanded groups where
we "fix" gtk's selection logic that the fixing seems interact badly
with the gtk range selection (shift-click) logic. If you range-select
from bottom up, it works correctly. Maybe we can work around that too
some way.

Give it a try. It seems to do the right thing for the things I tested,
but maybe it blows horribly for some case I didn't check.

                Linus


More information about the subsurface mailing list