fundamental design issues with trips and dives

Linus Torvalds torvalds at linux-foundation.org
Thu Nov 7 14:02:17 PST 2019


On Thu, Nov 7, 2019 at 12:14 PM Berthold Stoeger
<bstoeger at mail.tuwien.ac.at> wrote:
>
> It doesn't have to. Just like you defined a proxy model on top of the
> DiveListModel, one could implement a proxy model on top of the tree model that
> "linearizes" it.

Maybe we should do that in general, even for the desktop case.

I don't think there is any major reason why the model should contain
all the dives. In many ways it would be much better if the model only
contains the *visible* dives, and we'd have a totally flat model,
where a trip (whether it's a collapsed header only, or the header for
a list of dives that has been exposed) is just a special model entry.

That would mean that we'd handle collapsing and exposing trips by just
removing/inserting the dives in the trip into that flat model.

IOW, get rid of the tree model entirely, and make that "proxy" model
be "the" model.

Yes, yes, we have this very clever code to keep dives selected even
when they're not visible. It's a pain. it's probably not worth it.

And it might be truly *lovely* for startup if we didn't populate the
whole model at all. For the git format, we could literally avoid even
parsing the dives that are in a collapsed trip and this not visible.

So there would be potentially huge advantages to make the Qt models
really only contyain the dives that are actually visible.

But of course - I don't know any of the Qt code in question. I've
looked at it by mistake occasionally.

          Linus


More information about the subsurface mailing list