Hello Yves,
On Sat, Oct 10, 2009 at 6:18 AM, Yves-Alexis Perez <[email protected]> wrote:
> On ven, 2009-10-09 at 20:33 -0300, Otavio Salvador wrote:
>> Hello,
>>
>> On Fri, Oct 9, 2009 at 10:30 AM, Yves-Alexis Perez <[email protected]> wrote:
>> > Did you made the cleaning and upstream submitting? I guess it could be
>> > nice to have it included.
>>
>> We have a new version of it but we're in holiday. Next week we send
>> it for you and then we see if it fits well.
>>
>
> Imho it's quicker to directly report that upstream. There were two new
> exo stable releases recently, one fixing a hal related bug, so it should
> be no problem.
I prefer if you handle it upstream; we're quite busy here at work
nowadays and I doubt we'll be able to do that soon.
Attached our latest version of it.
--
Otavio Salvador O.S. Systems
E-mail: [email protected] http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
diff --git a/src/vfs/vfs-volume-hal.c b/src/vfs/vfs-volume-hal.c
index 818df29..684c38e 100644
--- a/src/vfs/vfs-volume-hal.c
+++ b/src/vfs/vfs-volume-hal.c
@@ -1178,6 +1178,8 @@ vfs_volume_update_volume_by_udi ( const gchar *udi)
static void vfs_volume_add( VFSVolume* volume )
{
volumes = g_list_append( volumes, volume );
+ vfs_volume_mount( volume, NULL );
+ vfs_volume_update_volume_by_udi( volume->udi );
call_callbacks( volume, VFS_VOLUME_ADDED );
}
--- a/src/vfs/vfs-volume-hal.c 2008-06-11 15:38:25.000000000 -0300
+++ b/src/vfs/vfs-volume-hal.c 2008-12-16 10:20:18.000000000 -0200
@@ -944,7 +944,7 @@
if (G_LIKELY (desired_mount_point != NULL && *desired_mount_point != '\0'))
{
filename = g_build_filename (mount_root, desired_mount_point, NULL);
- volume->mount_point = filename;
+ volume->mount_point = g_strdup( desired_mount_point );
}
libhal_free_string (desired_mount_point);
}
@@ -954,8 +954,7 @@
{
/* <mount-root>/<device> looks like a good idea */
basename = g_path_get_basename (volume->device_file);
- filename = g_build_filename (mount_root, basename, NULL);
- volume->mount_point = filename;
+ volume->mount_point = g_strdup( basename );
g_free (basename);
}
@@ -2310,7 +2309,7 @@
}
gboolean
-vfs_volume_hal_mount (ExoMountHalDevice *device,
+vfs_volume_hal_mount (VFSVolume *vol,
GError **error)
{
DBusMessage *message;
@@ -2323,8 +2322,13 @@
const gchar *uuid = NULL, *label = NULL;
gint m, n = 0;
VFSVolumeOptions opts;
+ ExoMountHalDevice* device = NULL;
+
+ g_return_val_if_fail (vol != NULL, FALSE);
+
+ if (!(device = vfs_volume_hal_from_udi( vol->udi, error )))
+ return FALSE;
- g_return_val_if_fail (device != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if( device->volume != NULL) {
@@ -2472,16 +2476,23 @@
}
}
- /* try to determine a usable mount point */
- if (G_LIKELY (device->volume != NULL))
+ if (G_LIKELY (vol->mount_point == NULL))
{
- /* maybe we can use the volume's label... */
- mount_point = g_strdup( libhal_volume_get_label (device->volume) );
+ /* try to determine a usable mount point */
+ if (G_LIKELY (device->volume != NULL))
+ {
+ /* maybe we can use the volume's label... */
+ mount_point = g_strdup( libhal_volume_get_label (device->volume) );
+ }
+ else
+ {
+ /* maybe we can use the the textual type... */
+ mount_point = g_strdup( libhal_drive_get_type_textual (device->drive) );
+ }
}
else
{
- /* maybe we can use the the textual type... */
- mount_point = g_strdup( libhal_drive_get_type_textual (device->drive) );
+ mount_point = g_strdup( vol->mount_point );
}
/* However, the label may contain G_DIR_SEPARATOR so just replace these
@@ -2825,13 +2836,10 @@
gboolean vfs_volume_mount( VFSVolume* vol, GError** err )
{
- ExoMountHalDevice* device;
gboolean ret = FALSE;
- device = vfs_volume_hal_from_udi( vol->udi, err );
- if( device )
+ if( vol )
{
- ret = vfs_volume_hal_mount( device, err );
- vfs_volume_hal_free( device );
+ ret = vfs_volume_hal_mount( vol, err );
}
return ret;
}