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




commit 6fb72f02fdcb33824b370351d237bf98fbed0aa2
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]