[gnome-software/1587-updates-glitchy-empty-list: 9/11] gs-updates-section: Use gtk_widget_get_ancestor()




commit 585078122e6f3e4d2e08d99b66d2ca6fe96fb9e3
Author: Milan Crha <mcrha redhat com>
Date:   Thu Aug 25 08:03:23 2022 +0200

    gs-updates-section: Use gtk_widget_get_ancestor()
    
    No need to manually traverse the widget structure.

 src/gs-updates-section.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
---
diff --git a/src/gs-updates-section.c b/src/gs-updates-section.c
index 5dd50d6b4..a705ab8d9 100644
--- a/src/gs-updates-section.c
+++ b/src/gs-updates-section.c
@@ -94,13 +94,7 @@ _row_unrevealed_cb (GObject *row, GParamSpec *pspec, gpointer data)
        if (widget == NULL)
                return;
 
-       /* Traverse the widget structure up to the GsUpdatesSection */
-       while (widget != NULL) {
-               if (GS_IS_UPDATES_SECTION (widget))
-                       break;
-               widget = gtk_widget_get_parent (widget);
-       }
-
+       widget = gtk_widget_get_ancestor (GTK_WIDGET (row), GS_TYPE_UPDATES_SECTION);
        g_return_if_fail (GS_IS_UPDATES_SECTION (widget));
        self = GS_UPDATES_SECTION (widget);
 


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