summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2013-03-29 17:58:58 +0100
committerJuan A. Suarez Romero <jasuarez@igalia.com>2013-04-04 16:11:11 +0200
commit28bb41fea5146f14139194d4f210eb7351cf2981 (patch)
tree562f0bd78408ffbe62d1e4acd89600bde25c5310
parenta3dd9a47afff1b94f3af0ae5720e8e86f9363de2 (diff)
optical-media: Don't show USB drives in the list
https://bugzilla.gnome.org/show_bug.cgi?id=679624
-rw-r--r--src/optical-media/grl-optical-media.c14
1 files changed, 14 insertions, 0 deletions
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);