From bcc03058d9d7b7de51e997d1d4030d8e2b08830b Mon Sep 17 00:00:00 2001 From: Xavier Jurado Date: Sun, 1 Feb 2026 14:06:26 +0000 Subject: [PATCH] nemo-places-sidebar.c: Sort network mounts alphabetically --- src/nemo-places-sidebar.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/nemo-places-sidebar.c b/src/nemo-places-sidebar.c index b60bf8934..564b30d15 100644 --- a/src/nemo-places-sidebar.c +++ b/src/nemo-places-sidebar.c @@ -373,6 +373,16 @@ sort_places_func (gconstpointer a, return g_utf8_collate (((PlaceInfo *) a)->name, ((PlaceInfo *) b)->name); } +static gint +sort_mounts_func (gconstpointer a, + gconstpointer b) +{ + g_autofree gchar *name_a = g_mount_get_name (G_MOUNT (a)); + g_autofree gchar *name_b = g_mount_get_name (G_MOUNT (b)); + + return g_utf8_collate (name_a, name_b); +} + static PlaceInfo * new_place_info (PlaceType place_type, SectionType section_type, @@ -1254,7 +1264,7 @@ update_places (NemoPlacesSidebar *sidebar) g_list_free_full (network_volumes, g_object_unref); - network_mounts = g_list_reverse (network_mounts); + network_mounts = g_list_sort(network_mounts, sort_mounts_func); for (l = network_mounts; l != NULL; l = l->next) { mount = l->data; root = g_mount_get_default_location (mount);