[gvfs] udisks2: Add appropriate content type for media players
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] udisks2: Add appropriate content type for media players
- Date: Thu, 4 Oct 2012 21:05:43 +0000 (UTC)
commit 4d39b17547648a6aa68d73c8d9ce9cbe23607cf8
Author: Martin Pitt <martinpitt gnome org>
Date: Thu Oct 4 22:23:10 2012 +0200
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
monitor/udisks2/gvfsudisks2mount.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/monitor/udisks2/gvfsudisks2mount.c b/monitor/udisks2/gvfsudisks2mount.c
index 0cb3f06..32b8cf3 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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]