[gnome-software/670-inconsistent-state-after-completing-update-all-operation] gs-updates-section: Auto-hide itself when all rows are removed



commit b2bc1a1be45a42ed0d2d609e0b8180054751d7bf
Author: Milan Crha <mcrha redhat com>
Date:   Wed Jan 20 20:11:51 2021 +0100

    gs-updates-section: Auto-hide itself when all rows are removed
    
    Also remove applications from the application list on their removal,
    thus the internal application list matches content of the GUI part.
    
    Closes https://gitlab.gnome.org/GNOME/gnome-software/-/issues/670

 src/gs-updates-section.c | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/gs-updates-section.c b/src/gs-updates-section.c
index 16c99331..eae24669 100644
--- a/src/gs-updates-section.c
+++ b/src/gs-updates-section.c
@@ -62,11 +62,20 @@ static void
 _row_unrevealed_cb (GObject *row, GParamSpec *pspec, gpointer data)
 {
        GtkWidget *list;
+       GsUpdatesSection *self;
 
        list = gtk_widget_get_parent (GTK_WIDGET (row));
        if (list == NULL)
                return;
+
+       self = GS_UPDATES_SECTION (list);
+
+       gs_app_list_remove (self->list, gs_app_row_get_app (GS_APP_ROW (row)));
+
        gtk_widget_destroy (GTK_WIDGET (row));
+
+       if (!gs_app_list_length (self->list))
+               gtk_widget_hide (list);
 }
 
 static void


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