Move to Qt?

Linus Torvalds torvalds at linux-foundation.org
Sat Mar 30 14:04:39 PDT 2013


On Sat, Mar 30, 2013 at 1:43 PM, Alberto Mardegan
<mardy at users.sourceforge.net> wrote:
>
> I don't think this applies to Subsurface; as far as I can see, there
> isn't even a single GObject subclass being defined in the code.

Yeah, we've tried to avoid unnecessary linkages with GLib. We use the
GTK GUI parts, and we use a *very* small subset of the "pure GLib"
stuff (ie some utf8 stuff and things like g_ascii_strtod and a
filesystem accessor helper or two), but we don't really build around
either.

In fact, I spent some time removing as much GLib and GTK data
structure use as possible. We had some GList use that just complicated
things unnecessarily, and we had a fair amount of code that worked by
traversing and modifying the GTK data structures (using the treeview
stuff to track the dive trip <-> dive relationships etc), and almost
all of that got rewritten. So now we just maintain our own simple data
structures and then basically redraw everything from scratch when they
change.

Re-creating the whole divelist from scratch might not scale well with
millions of dives, but happily, even if you're a dm in Hawaii it's
fairly hard to do more than a thousand dives a year. A ten thousand
dives over a lifetime is already considered quite a lot. And it's not
like we need to do it for things like "scroll through the list and
select a dive", only for "add/delete dives" or "move a dive from/to a
divetrip" etc.

We could probably re-organize some of our sources better, so that we'd
have a clearer separation between the UI code and the code that just
works on our our data structures. divelist.c in particular is a mix of
"pure gtk stuff" and "completely non-gtk stuff" partly due to the
history of doing the trip handling in particular using the treeview
data structures. There's a smattering of that elsewhere too, but
divelist.c is the worst offender.

                  Linus


More information about the subsurface mailing list