2006-04-03  Federico Mena Quintero  <federico@novell.com>

	* libgnomevfs/gnome-vfs-hal-mounts.c
	(_hal_add_drive_without_volumes): A drive with no mounted
	volumes is user-visible if it *does not* have
	storage.media_check_enabled turned on:  for example, floppy
	drives.  Since they don't provide media detection, they can't be
	auto-mounted by HAL/gnome-volume-manager.  This means that we need
	to make them visible in the GUI so that the user can mount them by
	hand.  See bug #321320.

--- gnome-vfs-2.12.2.orig/libgnomevfs/gnome-vfs-hal-mounts.c	2005-11-07 01:54:14.000000000 -0600
+++ gnome-vfs-2.12.2/libgnomevfs/gnome-vfs-hal-mounts.c	2006-04-03 13:10:46.000000000 -0500
@@ -816,6 +816,8 @@ _hal_add_drive_without_volumes (GnomeVFS
 	GnomeVFSVolumeMonitor *volume_monitor;
 	GnomeVFSHalUserData *hal_userdata;
 	char *name;
+	DBusError error;
+	gboolean media_check_enabled;
 
 	g_return_if_fail (hal_drive != NULL);
 
@@ -848,6 +850,18 @@ _hal_add_drive_without_volumes (GnomeVFS
 	/* doesn't make sense for devices without removable storage */
 	if (!libhal_drive_uses_removable_media (hal_drive))
 		goto out;
+
+	dbus_error_init (&error);
+	media_check_enabled = libhal_device_get_property_bool (volume_monitor_daemon->hal_ctx,
+							       libhal_drive_get_udi (hal_drive),
+							       "storage.media_check_enabled",
+							       &error);
+	if (dbus_error_is_set (&error)) {
+		g_warning ("Error retrieving storage.media_check_enabled on '%s': Error: '%s' Message: '%s'",
+			   libhal_drive_get_udi (hal_drive), error.name, error.message);
+		dbus_error_free (&error);
+		media_check_enabled = FALSE;
+	}
 	
 	drive = g_object_new (GNOME_VFS_TYPE_DRIVE, NULL);
 	drive->priv->activation_uri = g_strdup ("");
@@ -858,7 +872,7 @@ _hal_add_drive_without_volumes (GnomeVFS
 	name = _hal_drive_policy_get_display_name (volume_monitor_daemon, hal_drive, NULL);
 	drive->priv->display_name = _gnome_vfs_volume_monitor_uniquify_drive_name (volume_monitor, name);
 	g_free (name);
-	drive->priv->is_user_visible = TRUE;
+	drive->priv->is_user_visible = !media_check_enabled; /* See http://bugzilla.gnome.org/show_bug.cgi?id=321320 */
 	drive->priv->volumes = NULL;
 	drive->priv->hal_udi = g_strdup (libhal_drive_get_udi (hal_drive));
         drive->priv->must_eject_at_unmount = libhal_drive_requires_eject (hal_drive);
