Skip to content

Commit b73634b

Browse files
committed
nemo-places-sidebar.c: Sort network mounts alphabetically
1 parent 8ff42b6 commit b73634b

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/nemo-places-sidebar.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,17 @@ sort_places_func (gconstpointer a,
373373
return g_utf8_collate (((PlaceInfo *) a)->name, ((PlaceInfo *) b)->name);
374374
}
375375

376+
static gint
377+
sort_mounts_func(gconstpointer a,
378+
gconstpointer b)
379+
{
380+
g_autofree gchar *name_a, *name_b = NULL;
381+
name_a = g_mount_get_name(G_MOUNT(a));
382+
name_b = g_mount_get_name(G_MOUNT(b));
383+
384+
return g_utf8_collate(name_a, name_b);
385+
}
386+
376387
static PlaceInfo *
377388
new_place_info (PlaceType place_type,
378389
SectionType section_type,
@@ -1254,7 +1265,7 @@ update_places (NemoPlacesSidebar *sidebar)
12541265

12551266
g_list_free_full (network_volumes, g_object_unref);
12561267

1257-
network_mounts = g_list_reverse (network_mounts);
1268+
network_mounts = g_list_sort(network_mounts, sort_mounts_func);
12581269
for (l = network_mounts; l != NULL; l = l->next) {
12591270
mount = l->data;
12601271
root = g_mount_get_default_location (mount);

0 commit comments

Comments
 (0)