Index: libnautilus-private/nautilus-trash-directory.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-trash-directory.c,v
retrieving revision 1.37
diff -u -r1.37 nautilus-trash-directory.c
--- libnautilus-private/nautilus-trash-directory.c	13 Dec 2003 13:55:56 -0000	1.37
+++ libnautilus-private/nautilus-trash-directory.c	6 Sep 2005 00:00:01 -0000
@@ -265,6 +265,14 @@
 }
 
 static void
+volume_unmounted_callback (GnomeVFSVolumeMonitor *monitor,
+			   GnomeVFSVolume *volume,
+			   NautilusTrashDirectory *trash)
+{
+	remove_volume (trash, volume);
+}
+
+static void
 nautilus_trash_directory_instance_init (NautilusTrashDirectory *trash)
 {
 	GnomeVFSVolumeMonitor *volume_monitor;
@@ -278,6 +286,8 @@
 				 G_CALLBACK (volume_mounted_callback), trash, 0);
 	g_signal_connect_object (volume_monitor, "volume_pre_unmount",
 				 G_CALLBACK (volume_unmount_started_callback), trash, 0);
+	g_signal_connect_object (volume_monitor, "volume_unmounted",
+				 G_CALLBACK (volume_unmounted_callback), trash, 0);
 }
 
 /* Finish initializing a new NautilusTrashDirectory. We have to do the
--- libnautilus-private/nautilus-merged-directory.c~	2004-10-11 06:49:00.000000000 -0500
+++ libnautilus-private/nautilus-merged-directory.c	2005-09-06 17:03:10.000000000 -0500
@@ -27,6 +27,7 @@
 #include "nautilus-merged-directory.h"
 
 #include "nautilus-directory-private.h"
+#include "nautilus-directory-notify.h"
 #include "nautilus-file.h"
 #include <eel/eel-glib-extensions.h>
 #include <gtk/gtksignal.h>
@@ -540,6 +541,37 @@
 }
 
 static void
+real_directory_notify_files_removed (NautilusDirectory *real_directory)
+{
+	GList *files, *l;
+
+	files = nautilus_directory_get_file_list (real_directory);
+
+	for (l = files; l; l = l->next) {
+		NautilusFile *file;
+		char *uri;
+
+		file = NAUTILUS_FILE (l->data);
+		uri = nautilus_file_get_uri (file);
+		nautilus_file_unref (file);
+
+		l->data = uri;
+	}
+
+	if (files)
+		nautilus_directory_notify_files_removed (files);
+
+	for (l = files; l; l = l->next) {
+		char *uri;
+
+		uri = l->data;
+		g_free (uri);
+	}
+
+	g_list_free (files);
+}
+
+static void
 merged_remove_real_directory (NautilusMergedDirectory *merged,
 			      NautilusDirectory *real_directory)
 {
@@ -547,6 +579,9 @@
 	g_return_if_fail (NAUTILUS_IS_DIRECTORY (real_directory));
 	g_return_if_fail (g_list_find (merged->details->directories, real_directory) != NULL);
 
+	/* Since the real directory will be going away, act as if files were removed */
+	real_directory_notify_files_removed (real_directory);
+
 	/* Remove this directory from callbacks and monitors. */
 	eel_g_hash_table_safe_for_each (merged->details->callbacks,
 					merged_callback_remove_directory_cover,
