[gnome-software] updates: Fix verifying that there are updates in progress



commit 324a45e6ed14e7144c5717b531eb6a7f6c435787
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Mon Oct 9 14:51:43 2017 +0200

    updates: Fix verifying that there are updates in progress
    
    For getting whether there are upgrades in progress, the updates page
    gets all apps and verifies their state accordingly. This list was
    getting the apps from all sections and verifying their section
    in the loop. However, apps that are being updated will not match the
    expected section anymore as their state has changed.
    
    This resulted in the gs_shell_update_are_updates_in_progress function
    in fact not verifying any apps that were being updated...
    
    This patch fixes that by modifying the function that gathers all apps
    to just simply gather them while ignoring their current section.
    
    By fixing this, if there is an "updates-changed" signal being emitted,
    and updates being performed, the page will no longer be reloaded.

 src/gs-updates-page.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index c1f4d83..f9d9723 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -199,9 +199,16 @@ _get_all_apps (GsUpdatesPage *self)
 {
        GsAppList *apps = gs_app_list_new ();
        for (guint i = 0; i < GS_UPDATE_PAGE_SECTION_LAST; i++) {
-               g_autoptr(GsAppList) apps_tmp = NULL;
-               apps_tmp = _get_apps_for_section (self, i);
-               gs_app_list_add_list (apps, apps_tmp);
+               g_autoptr(GList) children = NULL;
+
+               if (self->listboxes[i] == NULL)
+                       continue;
+
+               children = gtk_container_get_children (GTK_CONTAINER (self->listboxes[i]));
+               for (GList *l = children; l != NULL; l = l->next) {
+                       GsAppRow *app_row = GS_APP_ROW (l->data);
+                       gs_app_list_add (apps, gs_app_row_get_app (app_row));
+               }
        }
        return apps;
 }


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