[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: second chanlist treeview patch



On Sat, Mar 22, 2003 at 05:07:42PM +1100, Peter Zelezny wrote:

> ListStore is implemented using TreeStore, so that should be a win.

It is?  Just looked like a glib slist...

> I was actually thinking of doing a custom MyListStore, using binary
> search trees.  I think it is possible to implement your own liststore
> like that.

Yep, should be.  I've got a reimplementation now in terms of glib's
balanced trees, indexing on the whole channel name.  Upsides:

- no linear search, we directly do a gtk_list_store_insert_after() once
  we lookup in the tree.  So should be genuinely less than O(n) insert
  time.
- less code since I'm not implementing tress myself

Cons:
- we insert every channel in, this means 13000 nodes, but I'm unsure of
  the exact overhead since I haven't checked the size of a glib balanced
  tree node.
- seems to use a little more cpu than the custom tree, plus it still
  grows.  It makes me think that the cpu usage is growing because of the
  TreeView, and not the store itself.

I have both versions now (the custom tree and the glib tree) but they're
both incomplete (haven't re-implemented the various buttons etc.) and
need cleaning up.  Any idea which approach you want to go for?

> > This patch basically implements our own private sorted insertion.  It
> > means we're not actually using the treeview's inbuilt sort at all (but I
> > think we should let the user do that once the list has finished loading,
> > so they can reverse sort).
> 
> Yeah, I guess we can trap clicks on the column headers?

Oh that's no worry.  You have to explicitly enable sorting to make them
clickable.  I was thinking I'd make a function that toggles sorting
on/off.  Every time the user grabs a fresh list, we toggle sorting off.
Once the list is over, we toggle it back on in fe_chan_list_end().

But I think we should move fe_chan_list_end() into chanlist.c, it's
currently in fe-gtk.c.  Any objections to this approach?

> The client-side filtering is a feature. Once the list has finished
> downloading, you can change the min/max numbers, and the list
> instantly changes.

Ah, okay.  I'll change it back :)

Cheers,

   Vince

-- 
    Vincent Ho
loki@internode.on.net

If pregnancy were a book they would cut the last two chapters.
        -- Nora Ephron, "Heartburn"
--
XChat-discuss: mailing list for XChat users
Archive:       http://mail.nl.linux.org/xchat-discuss/