small fix for ancient drives



Hey,

Currently with the HAL backend, gnome-vfs doesn't handle ancient drives
such as IDE Zip Drives or x86 floppy drives we cannot poll. This small
patch fixes that. OK to commit?

Cheers,
David
? compile
? foo
? gnome-vfs-zip
? imported/fnmatch/Makefile
? imported/fnmatch/Makefile.in
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-vfs/ChangeLog,v
retrieving revision 1.2233
diff -u -p -r1.2233 ChangeLog
--- ChangeLog	28 Jul 2005 01:34:30 -0000	1.2233
+++ ChangeLog	10 Aug 2005 20:50:50 -0000
@@ -1,3 +1,9 @@
+2005-08-10  David Zeuthen  <davidz redhat com>
+
+	* libgnomevfs/gnome-vfs-hal-mounts.c:
+	(_gnome_vfs_hal_mounts_modify_volume): Handle the drives that HAL
+	doesn't detect media for (e.g. IDE Zip drives, legacy x86 floppies)
+
 2005-07-28  Tor Lillqvist  <tml novell com>
 
 	* imported/neon/Makefile.am (libneon_la_LDFLAGS): As libneon is a
Index: libgnomevfs/gnome-vfs-hal-mounts.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-hal-mounts.c,v
retrieving revision 1.15
diff -u -p -r1.15 gnome-vfs-hal-mounts.c
--- libgnomevfs/gnome-vfs-hal-mounts.c	23 Jul 2005 22:28:15 -0000	1.15
+++ libgnomevfs/gnome-vfs-hal-mounts.c	10 Aug 2005 20:50:50 -0000
@@ -1475,6 +1475,24 @@ _gnome_vfs_hal_mounts_modify_volume (Gno
 	 */
 	hal_drive = libhal_drive_from_device_file (hal_ctx, volume->priv->device_path);
 	if (hal_drive != NULL) {
+
+		/* handle drives that HAL can't poll and the user can still mount */
+		if (libhal_device_get_property_bool (hal_ctx, 
+						     libhal_drive_get_udi (hal_drive),
+						     "storage.media_check_enabled",
+						     NULL) == FALSE) {
+			GnomeVFSDrive *drive;
+
+			if ((drive = _gnome_vfs_volume_monitor_find_drive_by_hal_udi (
+				     GNOME_VFS_VOLUME_MONITOR (volume_monitor_daemon),
+				     libhal_drive_get_udi (hal_drive))) != NULL) {
+				volume->priv->drive = drive;
+				_gnome_vfs_drive_add_mounted_volume (drive, volume);
+				
+				goto out;
+			}
+		}
+
 		/* ok, this device file is in HAL and thus managed by this backend */
 		gnome_vfs_volume_unref (volume);
 		result = NULL;


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