From d465523f6535dc48690f16027ab2b37efc1b1bbc Mon Sep 17 00:00:00 2001 From: segfault3 Date: Fri, 5 Apr 2019 19:58:56 +0000 Subject: [PATCH] gtkplacessidebar: Add loop devices --- gtk/gtkplacessidebar.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 03d2e7f523..91d7179161 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -1280,10 +1280,13 @@ update_places (GtkPlacesSidebar *sidebar) } g_list_free_full (drives, g_object_unref); - /* add all network volumes that is not associated with a drive */ + /* add all network volumes that are not associated with a drive, and + * loop devices + */ volumes = g_volume_monitor_get_volumes (sidebar->volume_monitor); for (l = volumes; l != NULL; l = l->next) { + gboolean is_loop = FALSE; volume = l->data; drive = g_volume_get_drive (volume); if (drive != NULL) @@ -1301,9 +1304,13 @@ update_places (GtkPlacesSidebar *sidebar) network_volumes = g_list_prepend (network_volumes, volume); continue; } + else if (g_strcmp0 (identifier, "loop") == 0) + is_loop = TRUE; g_free (identifier); - if (sidebar->show_other_locations && !is_external_volume (volume)) + if (sidebar->show_other_locations && + !is_external_volume (volume) && + !is_loop) { g_object_unref (volume); continue;