[gnome-software] Improve the sorting order on the Installed page



commit d516b7ffbd7e3a90b74f59831eecb7dd841c2314
Author: Kalev Lember <kalevlember gmail com>
Date:   Fri Jun 6 20:11:06 2014 +0200

    Improve the sorting order on the Installed page
    
    Previously, the sorting algorithm would take into account the install
    timestamp, which happened to be 0 for most apps. But not all, so some
    apps would seemingly randomly move to the bottom of the list after
    reinstalling (and a timestamp > 0 through that).
    
    Fix this by simply sorting by name.
    
    Also, while at this, make sure the sorting algorithm treats upper and
    lower case letters the same.

 src/gs-shell-installed.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index 744e02c..3aff1dd 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -355,6 +355,7 @@ static gchar *
 gs_shell_installed_get_app_sort_key (GsApp *app)
 {
        GString *key;
+       gchar *casefolded_name;
 
        key = g_string_sized_new (64);
 
@@ -396,12 +397,11 @@ gs_shell_installed_get_app_sort_key (GsApp *app)
                break;
        }
 
-       /* sort by install date */
-       g_string_append_printf (key, "%09" G_GUINT64_FORMAT ":",
-                               G_MAXUINT64 - gs_app_get_install_date (app));
-
        /* finally, sort by short name */
-       g_string_append (key, gs_app_get_name (app));
+       casefolded_name = g_utf8_casefold (gs_app_get_name (app), -1);
+       g_string_append (key, casefolded_name);
+       g_free (casefolded_name);
+
        return g_string_free (key, FALSE);
 }
 


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