[gtk/wip/otte/listmodels: 1/21] multisorter: Actually emit ::items-changed when items change




commit 46ce19d22a34e92be77e29663db201f2c957c526
Author: Benjamin Otte <otte redhat com>
Date:   Sat Jun 11 05:10:30 2022 +0200

    multisorter: Actually emit ::items-changed when items change

 gtk/gtkmultisorter.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtkmultisorter.c b/gtk/gtkmultisorter.c
index 72d686784b..90d6bb033d 100644
--- a/gtk/gtkmultisorter.c
+++ b/gtk/gtkmultisorter.c
@@ -402,6 +402,7 @@ gtk_multi_sorter_append (GtkMultiSorter *self,
 
   g_signal_connect (sorter, "changed", G_CALLBACK (gtk_multi_sorter_changed_cb), self);
   gtk_sorters_append (&self->sorters, sorter);
+  g_list_model_items_changed (G_LIST_MODEL (self), gtk_sorters_get_size (&self->sorters) - 1, 0, 1);
 
   gtk_sorter_changed_with_keys (GTK_SORTER (self),
                                 GTK_SORTER_CHANGE_MORE_STRICT,
@@ -434,6 +435,7 @@ gtk_multi_sorter_remove (GtkMultiSorter *self,
   sorter = gtk_sorters_get (&self->sorters, position);
   g_signal_handlers_disconnect_by_func (sorter, gtk_multi_sorter_changed_cb, self);
   gtk_sorters_splice (&self->sorters, position, 1, FALSE, NULL, 0);
+  g_list_model_items_changed (G_LIST_MODEL (self), position, 1, 0);
 
   gtk_sorter_changed_with_keys (GTK_SORTER (self),
                                 GTK_SORTER_CHANGE_LESS_STRICT,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]