Teach udisks(1) about the new automount hint and spell automount as one word
authorDavid Zeuthen <davidz@redhat.com>
Wed, 29 Jun 2011 14:09:19 +0000 (10:09 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Wed, 29 Jun 2011 14:09:19 +0000 (10:09 -0400)
It's automount, not "auto mount".

Signed-off-by: David Zeuthen <davidz@redhat.com>
data/org.freedesktop.UDisks.Device.xml
src/device-private.c
src/device-private.h
src/device.c
tools/udisks.c

index cdf6176..53e7e54 100644 (file)
       </doc:para></doc:description></doc:doc>
     </property>
 
-    <property name="DeviceAutoMountHint" type="s" access="read">
+    <property name="DeviceAutomountHint" type="s" access="read">
       <doc:doc><doc:description><doc:para>
             A hint to the desktop that indicates if a device should be automounted.
             Possible values are:
index 53196f3..45418ce 100644 (file)
@@ -109,14 +109,14 @@ ptr_str_array_from_strv (GStrv s)
 }
 
 void
-device_set_device_auto_mount_hint (Device *device,
-                                   const gchar *value)
+device_set_device_automount_hint (Device *device,
+                                  const gchar *value)
 {
-  if (G_UNLIKELY (g_strcmp0 (device->priv->device_auto_mount_hint, value) != 0))
+  if (G_UNLIKELY (g_strcmp0 (device->priv->device_automount_hint, value) != 0))
     {
-      g_free (device->priv->device_auto_mount_hint);
-      device->priv->device_auto_mount_hint = g_strdup (value);
-      emit_changed (device, "device_auto_mount_hint");
+      g_free (device->priv->device_automount_hint);
+      device->priv->device_automount_hint = g_strdup (value);
+      emit_changed (device, "device_automount_hint");
     }
 }
 
index f331ddc..32a9bd0 100644 (file)
@@ -133,7 +133,7 @@ struct DevicePrivate
   gboolean device_presentation_nopolicy;
   char *device_presentation_name;
   char *device_presentation_icon_name;
-  char *device_auto_mount_hint;
+  char *device_automount_hint;
 
   char *id_usage;
   char *id_type;
@@ -254,7 +254,7 @@ void device_set_job_initiated_by_uid (Device *device, guint value);
 void device_set_job_is_cancellable (Device *device, gboolean value);
 void device_set_job_percentage (Device *device, gdouble value);
 
-void device_set_device_auto_mount_hint (Device *device, const gchar *value);
+void device_set_device_automount_hint (Device *device, const gchar *value);
 void device_set_device_detection_time (Device *device, guint64 value);
 void device_set_device_media_detection_time (Device *device, guint64 value);
 void device_set_device_file (Device *device, const gchar *value);
index e39208d..9e886b3 100644 (file)
@@ -383,7 +383,7 @@ get_property (GObject *object,
       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);
+      g_value_set_string (value, device->priv->device_automount_hint);
       break;
     case PROP_DEVICE_FILE_PRESENTATION:
       if (device->priv->device_file_presentation != NULL)
@@ -871,7 +871,7 @@ device_class_init (DeviceClass *klass)
 
   g_object_class_install_property (object_class,
                                    PROP_DEVICE_AUTOMOUNT_HINT,
-                                   g_param_spec_string ("device-auto-mount-hint",
+                                   g_param_spec_string ("device-automount-hint",
                                                         NULL,
                                                         NULL,
                                                         NULL,
@@ -2291,7 +2291,7 @@ update_info_presentation (Device *device)
 {
   gboolean hide;
   gboolean nopolicy;
-  const gchar *auto_mount_hint;
+  const gchar *automount_hint;
 
   hide = FALSE;
   if (g_udev_device_has_property (device->priv->d, "UDISKS_PRESENTATION_HIDE"))
@@ -2308,11 +2308,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"));
 
-  auto_mount_hint = "";
+  automount_hint = "";
   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");
+    automount_hint = g_udev_device_get_property (device->priv->d, "UDISKS_AUTOMOUNT_HINT");
 
-  device_set_device_auto_mount_hint (device, auto_mount_hint);
+  device_set_device_automount_hint (device, automount_hint);
 
   return TRUE;
 }
index 6fbd6a6..97e80d7 100644 (file)
@@ -348,6 +348,7 @@ typedef struct
   gboolean device_presentation_nopolicy;
   char *device_presentation_name;
   char *device_presentation_icon_name;
+  char *device_automount_hint;
   guint64 device_size;
   guint64 device_block_size;
 
@@ -545,6 +546,8 @@ collect_props (const char *key,
     props->device_presentation_name = g_strdup (g_value_get_string (value));
   else if (strcmp (key, "DevicePresentationIconName") == 0)
     props->device_presentation_icon_name = g_strdup (g_value_get_string (value));
+  else if (strcmp (key, "DeviceAutomountHint") == 0)
+    props->device_automount_hint = g_strdup (g_value_get_string (value));
   else if (strcmp (key, "DeviceSize") == 0)
     props->device_size = g_value_get_uint64 (value);
   else if (strcmp (key, "DeviceBlockSize") == 0)
@@ -815,6 +818,7 @@ device_properties_free (DeviceProperties *props)
   g_strfreev (props->device_mount_paths);
   g_free (props->device_presentation_name);
   g_free (props->device_presentation_icon_name);
+  g_free (props->device_automount_hint);
   g_free (props->job_id);
   g_free (props->id_usage);
   g_free (props->id_type);
@@ -1221,6 +1225,7 @@ do_show_info (const char *object_path)
   g_print ("  presentation nopolicy:       %d\n", props->device_presentation_nopolicy);
   g_print ("  presentation name:           %s\n", props->device_presentation_name);
   g_print ("  presentation icon:           %s\n", props->device_presentation_icon_name);
+  g_print ("  automount hint:              %s\n", props->device_automount_hint);
   g_print ("  size:                        %" G_GUINT64_FORMAT "\n", props->device_size);
   g_print ("  block size:                  %" G_GUINT64_FORMAT "\n", props->device_block_size);