App sort key does not match displayed name
I noticed today that "Rhythmbox" is shown between "Krita" and "LibreOffice" in the Malcontent UI. The keen student of the Latin alphabet will notice that "R" does not come between "K" and "L". My desktop is in French – this will become relevant shortly.
The list is sorted based on g_app_info_get_display_name()
:
static gint
compare_app_info_cb (gconstpointer a,
gconstpointer b,
gpointer user_data)
{
GAppInfo *app_a = (GAppInfo*) a;
GAppInfo *app_b = (GAppInfo*) b;
return g_utf8_collate (g_app_info_get_display_name (app_a),
g_app_info_get_display_name (app_b));
}
However the displayed label in the UI is g_app_info_get_name
:
static GtkWidget *
create_row_for_app_cb (gpointer item,
gpointer user_data)
{
/* … */
app_name = g_app_info_get_name (app);
/* … */
/* App name label */
w = g_object_new (GTK_TYPE_LABEL,
"label", app_name,
"hexpand", TRUE,
"xalign", 0.0,
NULL);
Rhythmbox's English display name is "Rhythmbox music player", but French word order is different:
>>> r = Gio.DesktopAppInfo.new("org.gnome.Rhythmbox3.desktop")
>>> r.get_display_name()
'Lecteur de musique Rhythmbox'
>>> r.get_name()
'Rhythmbox'
Malcontent should consistently use one or the other. Since the name (not display name) is what is shown in the app grid and in Software, as well as in Malcontent's UI, it should sort on that as well.