[BUG] Default sorting order and deleting a trip, while switching sorting orders

Dirk Hohndel dirk at hohndel.org
Tue Feb 19 10:41:51 PST 2013


Linus Torvalds <torvalds at linux-foundation.org> writes:

> On Tue, Feb 19, 2013 at 10:20 AM, Dirk Hohndel <dirk at hohndel.org> wrote:
>>
>> This has no SOB... do you want me to apply it?
>
> I re-sent with a SOB and commit message (but maybe you want to expand on that)
>
>> What's your confidence level on "solves bug" vs. "causes possible new
>> ones"?
>
> It definitely solves a bug, and the bug behavior is actually very
> nasty - dives just disappear from the list as Lubomir noted.
>
> It's possible that the bug could be fixed by fixing whatever was wrong
> in the gtk tree model walker, but I couldn't understand it, and I
> don't really think it's even fixable (removing a trip will "free" all
> the dives in that trip, but now those free'd dives need to be sorted
> wrt *other* dives and trips that existed before outside that trip, and
> doing that with the gtk list sounds basically impossible.
>
> So I think the patch is needed.

Agreed. So I just pushed it out.

> As to whether it could expose new bugs - sure. That said, it really
> does simplify the code a lot, and the whole pattern of "let's just
> change our data structures and then re-create the whole dive list" is
> something we already depend on working in other places. So there may
> certainly be bugs there, but I don't think they'd be new bugs per se,
> perhaps just exposing existing bugs by making them easier to trigger..

I read it, it makes sense. It compiles and (wait for it) even worked
with a handful of random tests...

> And the gtk tree model walking really cannot work. See the other patch
> that converted the "remove dive from trip" case, which had similar
> issues: removing a dive isn't just moving it to the top level, you
> have to re-order things wrt that new top-level setup etc..

The code actually "kinda" worked with our old way of handling /
displaying trips. They were both broken in compatible ways. :-)

But you are right, it makes much more sense to throw away the Gtk code
and do this in our data structures instead. The less Gtk code we have
the better.

/D


More information about the subsurface mailing list