Commit e536ef06 authored by Bastien Nocera's avatar Bastien Nocera

settings-widget: Sort by alias rather than by name

parent 3948b2ae
......@@ -1406,20 +1406,20 @@ device_sort_func (gconstpointer a, gconstpointer b, gpointer data)
gboolean paired_a, paired_b;
gboolean trusted_a, trusted_b;
gboolean connected_a, connected_b;
g_autofree char *name_a = NULL;
g_autofree char *name_b = NULL;
g_autofree char *alias_a = NULL;
g_autofree char *alias_b = NULL;
g_object_get (row_a,
"paired", &paired_a,
"trusted", &trusted_a,
"connected", &connected_a,
"name", &name_a,
"alias", &alias_a,
NULL);
g_object_get (row_b,
"paired", &paired_b,
"trusted", &trusted_b,
"connected", &connected_b,
"name", &name_b,
"alias", &alias_b,
NULL);
/* First, paired or trusted devices (setup devices) */
......@@ -1440,13 +1440,13 @@ device_sort_func (gconstpointer a, gconstpointer b, gpointer data)
return 1;
}
if (name_a == NULL)
if (alias_a == NULL)
return 1;
if (name_b == NULL)
if (alias_b == NULL)
return -1;
/* And all being equal, alphabetically */
return g_utf8_collate (name_a, name_b);
return g_utf8_collate (alias_a, alias_b);
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment