GNOME Bugzilla – Bug 114657
Document sorting behaviour for gtk_tree_sortable_set_sort_column_id ()
Last modified: 2014-03-27 02:53:49 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()
AFAIK nothing of this has yet entered the documentation. However I'm told that the code in question has been sped up. Correct?
Moving docs bugs off the --- milestone.
closing out ancient bugs