From 13dd78be42053b203d4f058a2fe5212dd320d8ce Mon Sep 17 00:00:00 2001 From: Ayan George Date: Tue, 21 Jun 2011 20:43:09 -0400 Subject: [PATCH 4/4] * Added PROP_DEVICE_AUTOMOUNT_HINT to enum. * Added code to handle PROP_DEVICE_AUTOMOUNT_HINT to get_property(). * Installed AUTOMOUNT_HINT property in device_class_init(). * Properly handle UDISKS_AUTOMOUNT_HINT in update_info_presentation(). --- src/device.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/src/device.c b/src/device.c index 6a34940..15f60a2 100644 --- a/src/device.c +++ b/src/device.c @@ -176,6 +176,7 @@ enum PROP_0, PROP_NATIVE_PATH, + PROP_DEVICE_AUTOMOUNT_HINT, PROP_DEVICE_DETECTION_TIME, PROP_DEVICE_MEDIA_DETECTION_TIME, PROP_DEVICE_MAJOR, @@ -380,6 +381,9 @@ get_property (GObject *object, case PROP_DEVICE_FILE: g_value_set_string (value, device->priv->device_file); break; + case PROP_DEVICE_AUTOMOUNT_HINT: + g_value_set_string (value, device->priv->device_auto_mount_hint); + break; case PROP_DEVICE_FILE_PRESENTATION: if (device->priv->device_file_presentation != NULL) g_value_set_string (value, device->priv->device_file_presentation); @@ -863,6 +867,15 @@ device_class_init (DeviceClass *klass) NULL, NULL, G_PARAM_READABLE)); + + g_object_class_install_property (object_class, + PROP_DEVICE_AUTOMOUNT_HINT, + g_param_spec_string ("device-auto-mount-hint", + NULL, + NULL, + NULL, + G_PARAM_READABLE)); + g_object_class_install_property (object_class, PROP_DEVICE_DETECTION_TIME, g_param_spec_uint64 ("device-detection-time", @@ -2277,6 +2290,7 @@ update_info_presentation (Device *device) { gboolean hide; gboolean nopolicy; + const char *auto_mount_hint = ""; hide = FALSE; if (g_udev_device_has_property (device->priv->d, "UDISKS_PRESENTATION_HIDE")) @@ -2293,6 +2307,11 @@ update_info_presentation (Device *device) device_set_device_presentation_icon_name (device, g_udev_device_get_property (device->priv->d, "UDISKS_PRESENTATION_ICON_NAME")); + if (g_udev_device_has_property (device->priv->d, "UDISKS_AUTOMOUNT_HINT")) + auto_mount_hint = g_udev_device_get_property (device->priv->d, "UDISKS_AUTOMOUNT_HINT"); + + device_set_device_auto_mount_hint (device, auto_mount_hint); + return TRUE; } -- 1.7.4.1