From 28bb41fea5146f14139194d4f210eb7351cf2981 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 29 Mar 2013 17:58:58 +0100 Subject: optical-media: Don't show USB drives in the list https://bugzilla.gnome.org/show_bug.cgi?id=679624 --- src/optical-media/grl-optical-media.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/optical-media/grl-optical-media.c b/src/optical-media/grl-optical-media.c index 7bdc1ad..f04fd5c 100644 --- a/src/optical-media/grl-optical-media.c +++ b/src/optical-media/grl-optical-media.c @@ -355,12 +355,26 @@ add_drive (GList *media_list, GrlOpticalMediaSource *source) { GList *volumes, *i; + GIcon *icon; if (g_drive_can_eject (drive) == FALSE || g_drive_has_media (drive) == FALSE) { return media_list; } + /* Hack to avoid USB devices showing up + * https://bugzilla.gnome.org/show_bug.cgi?id=679624 */ + icon = g_drive_get_icon (drive); + if (icon && G_IS_THEMED_ICON (icon)) { + const gchar * const * names; + names = g_themed_icon_get_names (G_THEMED_ICON (icon)); + if (names && names[0] && !g_str_has_prefix (names[0], "drive-optical")) { + g_object_unref (icon); + return media_list; + } + } + g_clear_object (&icon); + /* Repeat for all the drive's volumes */ volumes = g_drive_get_volumes (drive); -- cgit v1.2.3