[gnome-software/gnome-3-26] Show the highest available distro upgrade



commit af92915491312ed2feaadbc8ea835db86ade1baa
Author: Kalev Lember <klember redhat com>
Date:   Tue Oct 24 14:37:42 2017 +0200

    Show the highest available distro upgrade
    
    The intent was always to show the highest version (e.g. F27 over F26),
    but the implementation broke when GsAppList switched from list to array,
    reversing the sort order.
    
    This commit switches the UI code over to relying on getting upgrades in
    the ascending sort order from the plugin loader.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1494061

 src/gs-updates-page.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index 32ed79c..d82a653 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -1045,7 +1045,8 @@ gs_updates_page_get_upgrades_cb (GObject *source_object,
                gs_updates_page_clear_flag (self, GS_UPDATES_PAGE_FLAG_HAS_UPGRADES);
                gtk_widget_set_visible (self->upgrade_banner, FALSE);
        } else {
-               GsApp *app = gs_app_list_index (list, 0);
+               /* rely on the app list already being sorted */
+               GsApp *app = gs_app_list_index (list, gs_app_list_length (list) - 1);
                g_debug ("got upgrade %s", gs_app_get_id (app));
                gs_upgrade_banner_set_app (GS_UPGRADE_BANNER (self->upgrade_banner), app);
                gs_updates_page_set_flag (self, GS_UPDATES_PAGE_FLAG_HAS_UPGRADES);


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