From 58d9717399b5c29cce3307e0ff950181fb0096c0 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Mon, 10 Jul 2023 12:26:41 -0700 Subject: [PATCH] libsysprof-gtk: emit items-changed if session changes That way we can generate new items with a proper session pointer. --- src/libsysprof-gtk/sysprof-session-model.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/libsysprof-gtk/sysprof-session-model.c b/src/libsysprof-gtk/sysprof-session-model.c index 12fa915a..e59bb40e 100644 --- a/src/libsysprof-gtk/sysprof-session-model.c +++ b/src/libsysprof-gtk/sysprof-session-model.c @@ -250,5 +250,12 @@ sysprof_session_model_set_session (SysprofSessionModel *self, g_return_if_fail (!session || SYSPROF_IS_SESSION (session)); if (g_set_object (&self->session, session)) - g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SESSION]); + { + guint n_items = g_list_model_get_n_items (G_LIST_MODEL (self)); + + if (n_items > 0) + g_list_model_items_changed (G_LIST_MODEL (self), 0, n_items, n_items); + + g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SESSION]); + } }