summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2012-10-04 22:23:10 +0200
committerMartin Pitt <martinpitt@gnome.org>2012-10-04 23:05:33 +0200
commit4d39b17547648a6aa68d73c8d9ce9cbe23607cf8 (patch)
tree5d086707ee76e26c30762455e17d731ae3d7b8a3 /monitor
parent867cd04972606757549c64f8407edbbbe49d9555 (diff)
udisks2: Add appropriate content type for media players
If a device has an ID_MEDIA_PLAYER udev property, add the x-content/audio-player content type so that gvfs clients like nautilus offer opening an audio player instead of a file browser. https://bugzilla.gnome.org/show_bug.cgi?id=619583
Diffstat (limited to 'monitor')
-rw-r--r--monitor/udisks2/gvfsudisks2mount.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/monitor/udisks2/gvfsudisks2mount.c b/monitor/udisks2/gvfsudisks2mount.c
index 0cb3f06c..32b8cf3d 100644
--- a/monitor/udisks2/gvfsudisks2mount.c
+++ b/monitor/udisks2/gvfsudisks2mount.c
@@ -1206,7 +1206,6 @@ gvfs_udisks2_mount_guess_content_type_sync (GMount *_mount,
}
}
- /* Check if its bootable */
if (mount->device_file != NULL)
{
GUdevDevice *gudev_device;
@@ -1214,8 +1213,14 @@ gvfs_udisks2_mount_guess_content_type_sync (GMount *_mount,
mount->device_file);
if (gudev_device != NULL)
{
+ /* Check if its bootable */
if (g_udev_device_get_property_as_boolean (gudev_device, "OSINFO_BOOTABLE"))
g_ptr_array_add (p, g_strdup ("x-content/bootable-media"));
+
+ /* Check for media player */
+ if (g_udev_device_has_property (gudev_device, "ID_MEDIA_PLAYER"))
+ g_ptr_array_add (p, g_strdup ("x-content/audio-player"));
+
g_object_unref (gudev_device);
}
}