After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 114657 - Document sorting behaviour for gtk_tree_sortable_set_sort_column_id ()
Document sorting behaviour for gtk_tree_sortable_set_sort_column_id ()
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Documentation
2.2.x
Other Linux
: Normal normal
: Small fix
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-06-07 20:48 UTC by Linus Walleij
Modified: 2014-03-27 02:53 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10



Description Linus Walleij 2003-06-07 20:48:20 UTC
Information from the gtk-list gives at hand that invoking this function
under certain circumstances has some undesired side effects. I propose
adding the following text to the manual section on GtkSortable or in the FAQ:

------------
Calling gtk_tree_sortable_set_sort_column_id() on a certain GtkTreeStore or
GtkListStore will turn on sorting for this list store. This will slow down
performance on subsequent data additions from O(n) to O(n^2). There is no
way to turn sorting off again. If you repeatedly add several (say
thousands) of rows to a tree or list store, this will cause a noticable delay.

Therefore, if you desire large, sorted lists and trees, the procedure to
follow when filling the store anew is:

1. Create a new list store with gtk_list_store_new()
2. Replace it for the one currently connected to your view with
gtk_tree_view_set_model()
3. Invoke g_object_unref() on the old store and destroy it.
4. Fill the new store with some thousand entries.
5. Turn sorting back on using gtk_tree_sortable_set_sort_column_id()
Comment 1 Linus Walleij 2004-01-14 22:27:44 UTC
AFAIK nothing of this has yet entered the documentation. However I'm
told that the code in question has been sped up. Correct?
Comment 2 Matthias Clasen 2004-02-02 09:01:29 UTC
Moving docs bugs off the --- milestone.
Comment 3 Matthias Clasen 2014-03-27 02:53:49 UTC
closing out ancient bugs