sort list model section issues
A lot of things go wrong when you change section sorters on a sortlistmodel.
Here's a test I wrote:
store = new_store ((guint[]) { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 });
model = new_model (store);
sorter = GTK_SORTER (gtk_custom_sorter_new (by_n, GUINT_TO_POINTER (3), NULL));
gtk_sort_list_model_set_section_sorter (model, sorter);
g_object_unref (sorter);
assert_changes (model, "s0:10");
assert_section_model (model, "[1 2] [3 4 5] [6 7 8] [9 10]");
sorter = GTK_SORTER (gtk_custom_sorter_new (by_n, GUINT_TO_POINTER (5), NULL));
gtk_sort_list_model_set_section_sorter (model, sorter);
g_object_unref (sorter);
assert_changes (model, "s0:10");
assert_section_model (model, "[1 2 3 4] [5 6 7 8 9] [10]");
The last assertion fails because the sortlistmodel still thinks its section are "[1 2] [3 4 5] [6 7 8] [9 10]".
I assume that the handling of changes to sort_keys and section_sort_keys is confused.
If I add a gtk_sort_list_model_set_section_sorter (model, NULL)
in the middle, things work.
I don't have the bandwidth to track this down atm.