Re: GtkListStore and GtkSequence



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.

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.

-- 
Bye,
-Torsten




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