libpurple/purplenotificationmanager.c

changeset 43128
1ce3ad90614c
parent 43071
071588186662
--- a/libpurple/purplenotificationmanager.c	Fri Jan 03 00:38:29 2025 -0600
+++ b/libpurple/purplenotificationmanager.c	Tue Jan 07 04:49:09 2025 -0600
@@ -412,6 +412,7 @@
 
 	g_signal_emit(G_OBJECT(manager), signals[SIG_ADDED], 0, notification);
 	g_list_model_items_changed(G_LIST_MODEL(manager), 0, 0, 1);
+	g_object_notify_by_pspec(G_OBJECT(manager), properties[PROP_N_ITEMS]);
 }
 
 void
@@ -447,6 +448,7 @@
 
 		g_signal_emit(G_OBJECT(manager), signals[SIG_REMOVED], 0, notification);
 		g_list_model_items_changed(G_LIST_MODEL(manager), index, 1, 0);
+		g_object_notify_by_pspec(G_OBJECT(manager), properties[PROP_N_ITEMS]);
 
 		g_object_unref(notification);
 	}
@@ -535,6 +537,8 @@
 				/* Remove the run of items from the list. */
 				g_ptr_array_remove_range(manager->notifications, start, count);
 				g_list_model_items_changed(model, start, count, 0);
+				g_object_notify_by_pspec(G_OBJECT(manager),
+				                         properties[PROP_N_ITEMS]);
 
 				/* Adjust pos and len for the items that we removed. */
 				pos = pos - count;
@@ -549,6 +553,7 @@
 	if(have_same) {
 		g_ptr_array_remove_range(manager->notifications, start, count);
 		g_list_model_items_changed(model, start, count, 0);
+		g_object_notify_by_pspec(G_OBJECT(manager), properties[PROP_N_ITEMS]);
 	}
 }
 
@@ -578,4 +583,5 @@
 	g_ptr_array_remove_range(manager->notifications, 0, count);
 
 	g_list_model_items_changed(G_LIST_MODEL(manager), 0, count, 0);
+	g_object_notify_by_pspec(G_OBJECT(manager), properties[PROP_N_ITEMS]);
 }

mercurial