GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID does not work for gtk_tree_sortable_set_sort_column_id
Submitted by 12oClocker
Assigned to gtk..@..tk.org
Link to original bug (#780568)
Description
per documentation here... https://developer.gnome.org/gtk3/stable/GtkTreeSortable.html#GTK-TREE-SORTABLE-UNSORTED-SORT-COLUMN-ID:CAPS
And per documentation here... https://developer.gnome.org/gtk3/3.22/GtkTreeSortable.html#GTK-TREE-SORTABLE-UNSORTED-SORT-COLUMN-ID:CAPS
GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID should be able to disable sorting when used with gtk_tree_view_column_set_sort_column_id, but instead it does not work, we get the error message... Gtk-CRITICAL **:gtk_tree_view_column_set_sort_column_id: assertion 'sort_column_id >= -1' failed
This is because in source code... file: gtk+-3.22.0/gtk/gtktreeviewcolumn.c" function: gtk_tree_view_column_set_sort_column_id line: 2641 the following line of... g_return_if_fail (sort_column_id >= -1); should actually be... g_return_if_fail (sort_column_id >= -2);
It is desirable for this feature to work, because users may want to disable sorting on a treeview that was previously sorted. Simply changing the -1 to -2 on line 2641 of file /gtk/gtktreeviewcolumn.c should fix the issue.