[gvfs] gdu,udisks2: Make use of new udev property



commit aef8cb24acc65bf4237f66a923932fcd7df031b7
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Thu Sep 15 04:25:50 2011 +0300

    gdu,udisks2: Make use of new udev property
    
    New udev/blkid expose more ISO9660 properties, including 'Boot System
    ID'. Existance of this property implies that media is bootable. The
    libosinfo udev rules that provided the 'OSINFO_BOOTABLE' property will
    soon be ditched as a result but we better keep the check for backward
    compatibility.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694007

 monitor/gdu/ggdumount.c            |    7 ++++++-
 monitor/udisks2/gvfsudisks2mount.c |    7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/monitor/gdu/ggdumount.c b/monitor/gdu/ggdumount.c
index 9272c3a..46779c9 100644
--- a/monitor/gdu/ggdumount.c
+++ b/monitor/gdu/ggdumount.c
@@ -1380,7 +1380,12 @@ g_gdu_mount_guess_content_type_sync (GMount              *_mount,
           gudev_device = g_udev_client_query_by_device_file (client, device_file);
           if (gudev_device != NULL)
             {
-              if (g_udev_device_get_property_as_boolean (gudev_device,
+              const gchar *boot_sys_id;
+
+              boot_sys_id = g_udev_device_get_property (gudev_device,
+                                                        "ID_FS_BOOT_SYSTEM_ID");
+              if (boot_sys_id != NULL ||
+                  g_udev_device_get_property_as_boolean (gudev_device,
                                                          "OSINFO_BOOTABLE"))
                   g_ptr_array_add (p, g_strdup ("x-content/bootable-media"));
 
diff --git a/monitor/udisks2/gvfsudisks2mount.c b/monitor/udisks2/gvfsudisks2mount.c
index f19f3ab..dd00db4 100644
--- a/monitor/udisks2/gvfsudisks2mount.c
+++ b/monitor/udisks2/gvfsudisks2mount.c
@@ -1240,7 +1240,12 @@ gvfs_udisks2_mount_guess_content_type_sync (GMount        *_mount,
       if (gudev_device != NULL)
         {
           /* Check if its bootable */
-          if (g_udev_device_get_property_as_boolean (gudev_device, "OSINFO_BOOTABLE"))
+          const gchar *boot_sys_id;
+
+          boot_sys_id = g_udev_device_get_property (gudev_device,
+                                                    "ID_FS_BOOT_SYSTEM_ID");
+          if (boot_sys_id != NULL ||
+              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 */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]