[gnome-software/1690-button-to-go-back-is-missing-in-os-updates-page-opened-from-installed-updates-window] gs-update-dialog: Read 'title' property only when it exists



commit 12d71b9c9002c97a0f8a5b28d89adcc9a73ce0aa
Author: Milan Crha <mcrha redhat com>
Date:   Mon Mar 28 16:51:37 2022 +0200

    gs-update-dialog: Read 'title' property only when it exists
    
    Not every widget packed in the leaflet has the 'title' property,
    thus read it only if any such exists. This could cause runtime
    warning when moving through installed updates.

 src/gs-update-dialog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index 6bcbce10c..22d5654be 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -56,7 +56,7 @@ leaflet_child_transition_cb (AdwLeaflet *leaflet, GParamSpec *pspec, GsUpdateDia
                adw_leaflet_remove (leaflet, child);
 
        child = adw_leaflet_get_visible_child (leaflet);
-       if (child != NULL) {
+       if (child != NULL && g_object_class_find_property (G_OBJECT_CLASS (GTK_WIDGET_GET_CLASS (child)), 
"title") != NULL) {
                g_autofree gchar *title = NULL;
                g_object_get (G_OBJECT (child), "title", &title, NULL);
                gtk_window_set_title (GTK_WINDOW (dialog), title);


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