[gnome-software/wip/hughsie/fix-alternates-regression: 5/12] trivial: Do not re-get the list of alternates for every page refresh



commit 91b5b89883d25d78b685fc78ff5f586d088746b8
Author: Richard Hughes <richard hughsie com>
Date:   Mon Oct 8 17:11:17 2018 +0100

    trivial: Do not re-get the list of alternates for every page refresh
    
    The gs_details_page_refresh_all() function is supposed to be passive, i.e. just
    update widgets. We only need to re-get the alternates list when the app changes,
    so move it to a more suitable place.
    
    Fixes GET_ALTERNATES being called twice for every page load.

 src/gs-details-page.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index c3d6597f..5b9c0f6f 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -1008,9 +1008,6 @@ gs_details_page_refresh_all (GsDetailsPage *self)
                gtk_widget_set_visible (self->application_details_summary, FALSE);
        }
 
-       /* set the alternates shown in the header bar */
-       gs_details_page_set_alternates (self);
-
        /* refresh buttons */
        gs_details_page_refresh_buttons (self);
 
@@ -1955,6 +1952,9 @@ gs_details_page_set_app (GsDetailsPage *self, GsApp *app)
 
        gs_details_page_load (self);
 
+       /* set the alternates shown in the header bar */
+       gs_details_page_set_alternates (self);
+
        /* change widgets */
        gs_details_page_refresh_all (self);
 


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