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



commit 2218f85e908e8fdea64771d03b0d4fc165b73429
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-shell-updates.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index 98e4903..d586914 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -559,7 +559,8 @@ gs_shell_updates_get_upgrades_cb (GObject *source_object,
                g_debug ("updates-shell: no upgrades to show");
                gs_shell_updates_clear_flag (self, GS_SHELL_UPDATES_FLAG_HAS_UPGRADES);
        } 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_shell_updates_set_flag (self, GS_SHELL_UPDATES_FLAG_HAS_UPGRADES);


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