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



commit 39fe345ab25a5dc68db7ddc078f772ec78e62e35
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 ae3aac1..994513e 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -547,7 +547,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]