Re: GtkListStore and GtkSequence



Am Montag, den 09.08.2004, 13:40 +0200 schrieb Torsten Schoenfeld:
> On Sat, 2004-08-07 at 22:30, Soeren Sandmann wrote:
> 
> > The attached patch reimplements GtkListStore in terms of a new data
> > structure, GtkSequence. This data structure has the API of a list, but
> > is internally implemented as a tree, making inserting into a sorted
> > GtkListStore O(log n) instead of O(n) as it is now.
> 
> If I understand it correctly, this is about making inserting many rows
> into a sorted store faster.  If so, then there's also another possible
> solution: Provide API to make the store temporarily unsorted.  You could
> then use that API, insert your rows, and finally make the store sorted
> again.
> 

Not really. This is about using a different data structure which allows
more operations to be done in O(log n) or even O(1) instead of O(n).

> This sort of already works.  You just need to get rid of some
> assertions, IIRC.  -2 is the magical sort column id that tells both
> GtkListStore and GtkTreeStore that they're unsorted.  gtkliststore.c for
> example defines
> 
>   #define GTK_LIST_STORE_IS_SORTED(list) (GTK_LIST_STORE (list)->sort_column_id != -2)
> 
> If this is considered passable, I could try to come up with a patch.

We may want this anyway.

Matthias




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