diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 83c9f88a8e..8dc6d301f1 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -823,36 +823,29 @@ out: } static gboolean -is_removable_volume (GVolume *volume) +is_external_volume (GVolume *volume) { - gboolean is_removable; + gboolean is_external; GDrive *drive; - GMount *mount; gchar *id; drive = g_volume_get_drive (volume); - mount = g_volume_get_mount (volume); id = g_volume_get_identifier (volume, G_VOLUME_IDENTIFIER_KIND_CLASS); - is_removable = g_volume_can_eject (volume); + is_external = g_volume_can_eject (volume); /* NULL volume identifier only happens on removable devices */ - is_removable |= !id; + is_external |= !id; if (drive) - { - is_removable |= g_drive_can_eject (drive); - is_removable |= g_drive_is_media_removable (drive); - } - - if (mount) - is_removable |= (g_mount_can_eject (mount) && !g_mount_can_unmount (mount)); + is_external |= g_drive_can_eject (drive) || + g_drive_is_media_removable (drive) || + g_drive_can_stop (drive); g_clear_object (&drive); - g_clear_object (&mount); g_free (id); - return is_removable; + return is_external; } static void @@ -991,7 +984,7 @@ update_places (GtkPlacesSidebar *sidebar) } g_free (identifier); - if (sidebar->show_other_locations && !is_removable_volume (volume)) + if (sidebar->show_other_locations && !is_external_volume (volume)) { g_object_unref (volume); continue; @@ -1095,7 +1088,7 @@ update_places (GtkPlacesSidebar *sidebar) } g_free (identifier); - if (sidebar->show_other_locations && !is_removable_volume (volume)) + if (sidebar->show_other_locations && !is_external_volume (volume)) { g_object_unref (volume); continue;