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



commit d7524e79985b7587af8fa45f1c529a283193bf30
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 bbe6943b..17cc6a69 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);
 
@@ -1952,6 +1949,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]