treelistrowsorter: Fix a faulty example

gtk_tree_list_row_sorter_new() consumes the
sorter, so we can't pass gtk_column_view_get_sorter(),
since that is transfer none.
This commit is contained in:
Matthias Clasen 2020-07-15 22:13:36 -04:00
parent 594ec3d822
commit 500dbaabc3

View File

@ -39,7 +39,8 @@
* a GtkTreeListSorter: * a GtkTreeListSorter:
* *
* |[ * |[
* sorter = gtk_tree_list_row_sorter_new (gtk_column_view_get_sorter (view)); * column_sorter = gtk_column_view_get_sorter (view);
* sorter = gtk_tree_list_row_sorter_new (g_object_ref (column_sorter));
* sort_model = gtk_sort_list_model_new (tree_model, sorter); * sort_model = gtk_sort_list_model_new (tree_model, sorter);
* selection = gtk_single_selection_new (sort_model); * selection = gtk_single_selection_new (sort_model);
* gtk_column_view_set_model (view, G_LIST_MODEL (selection)); * gtk_column_view_set_model (view, G_LIST_MODEL (selection));