Nautilus doesn't detect cdrom (and other media) correct on debian

Mattias Eriksson snaggen@acc.umu.se
Sat, 10 Apr 2004 10:13:58 +0200


--=-At37Nnn8Q2QC/Emx7101
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Nautilus looks at the device and if it is /dev/cdrom it assumes that it
is a cdrom. But if /dev/cdrom is not used in /etc/fstab it looks at the
mountpoint, but it only looks in /mnt/. Since debian uses /cdrom for
mountpoint nautilus will detect it as a harddrive. 
I might mention that if you use gnome-volume-manager you cant use the
link /dev/cdrom since it gets notifications about the real device.

This patch (sent upstream too) will fix the nautilus detection code.

//Snaggen

--=-At37Nnn8Q2QC/Emx7101
Content-Disposition: attachment; filename=gnomevfs_volume.patch
Content-Type: text/x-patch; name=gnomevfs_volume.patch; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

Index: libgnomevfs/gnome-vfs-volume-monitor-daemon.c
===================================================================
RCS file: /cvs/gnome/gnome-vfs/libgnomevfs/gnome-vfs-volume-monitor-daemon.c,v
retrieving revision 1.6
diff -u -B -b -r1.6 gnome-vfs-volume-monitor-daemon.c
--- libgnomevfs/gnome-vfs-volume-monitor-daemon.c	27 Jan 2004 18:59:13 -0000	1.6
+++ libgnomevfs/gnome-vfs-volume-monitor-daemon.c	9 Apr 2004 18:05:21 -0000
@@ -258,8 +258,25 @@
 			} else if (g_str_has_prefix (name, "memstick")) {
 				return GNOME_VFS_DEVICE_TYPE_MEMORY_STICK;
 			}
+		} else {
+			if ((g_strrstr (mount_path, "/cdrom") != NULL) ||
+					(g_strrstr (mount_path, "/burn") != NULL)) {
+				return GNOME_VFS_DEVICE_TYPE_CDROM;
+			} else if (g_strrstr (mount_path, "/floppy") != NULL) {
+				return GNOME_VFS_DEVICE_TYPE_FLOPPY;
+			} else if (g_strrstr (mount_path, "/zip") != NULL) {
+				return GNOME_VFS_DEVICE_TYPE_ZIP;
+			} else if (g_strrstr (mount_path, "/jaz") != NULL) {
+				return GNOME_VFS_DEVICE_TYPE_JAZ;
+			} else if (g_strrstr (mount_path, "/camera") != NULL) {
+				return GNOME_VFS_DEVICE_TYPE_CAMERA;
+			} else if ((g_strrstr (mount_path, "/memstick") != NULL) ||
+					(g_strrstr (mount_path, "/ram") != NULL)) {
+				return GNOME_VFS_DEVICE_TYPE_MEMORY_STICK;
+			} else if (g_strrstr (mount_path, "/ipod") != NULL) {
+				return GNOME_VFS_DEVICE_TYPE_MUSIC_PLAYER;
+			} 
 		}
-
 	return GNOME_VFS_DEVICE_TYPE_HARDDRIVE;
 }
 

--=-At37Nnn8Q2QC/Emx7101--