Package: exo
Version: 0.3.4-6
Severity: wishlist
Tags: patch

While working at a customization here at O.S. Systems, we came up with
the attached patch that adds support to exo to consult HAL about the
preferred mount point that could be defined using a policy.

I think this is a nice improvement and would be nice to get it up to
upstream and add it there too if possible.

TIA,

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Index: exo-0.3.4/exo-mount/exo-mount-hal.c
===================================================================
--- exo-0.3.4.orig/exo-mount/exo-mount-hal.c	2008-05-08 15:34:02.000000000 -0300
+++ exo-0.3.4/exo-mount/exo-mount-hal.c	2008-05-08 15:34:26.000000000 -0300
@@ -708,13 +708,32 @@
         }
     }
 
+  char *hal_mount_point;
+
   /* try to determine a usable mount point */
   if (G_LIKELY (device->volume != NULL))
     {
-      /* maybe we can use the volume's label... */
-      mount_point = (gchar *) libhal_volume_get_label (device->volume);
+      const char *drive_udi = libhal_volume_get_storage_device_udi (device->volume);
+
+      if (device->drive != NULL)
+        {
+          hal_mount_point = libhal_device_get_property_string (hal_context, device->drive, "storage.policy.desired_mount_point", NULL);
+          if (hal_mount_point != NULL)
+            {
+              mount_point = g_strdup (hal_mount_point);
+              libhal_free_string(hal_mount_point);
+            }
+        }
     }
-  else
+
+    hal_mount_point = libhal_device_get_property_string (hal_context, libhal_volume_get_udi (device->volume), "volume.policy.desired_mount_point", NULL);
+    if (hal_mount_point != NULL)
+      {
+        mount_point = g_strdup (hal_mount_point);
+        libhal_free_string(hal_mount_point);
+      }
+
+  if (mount_point == NULL)
     {
       /* maybe we can use the the textual type... */
       mount_point = (gchar *) libhal_drive_get_type_textual (device->drive);
_______________________________________________
Pkg-xfce-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-xfce-devel

Reply via email to