Index: libegg/recent-files/egg-recent-view-gtk.c
===================================================================
RCS file: /cvs/gnome/libegg/libegg/recent-files/egg-recent-view-gtk.c,v
retrieving revision 1.27
diff -u -r1.27 egg-recent-view-gtk.c
--- libegg/recent-files/egg-recent-view-gtk.c	3 Jul 2005 01:19:45 -0000	1.27
+++ libegg/recent-files/egg-recent-view-gtk.c	7 Jul 2005 07:39:21 -0000
@@ -216,10 +216,10 @@
 {
 	GtkWidget *menu_item;
 	EggRecentViewGtkMenuData *md;
-	gchar *mime_type;
 	GtkWidget *image;
 	GtkWidget *label;
 	GdkPixbuf *pixbuf;
+	gchar *uri;
 	gchar *text;
 	gchar *short_name;
 	gchar *escaped;
@@ -227,6 +227,10 @@
 	g_return_val_if_fail (view, NULL);
 	g_return_val_if_fail (item, NULL);
 
+	uri = egg_recent_item_get_uri (item);
+	if (!uri)
+		return NULL;
+
 	short_name = egg_recent_item_get_short_name (item);
 	if (!short_name)
 		return NULL;
@@ -247,22 +251,22 @@
 		text = escaped;
 	}
 
-	mime_type = egg_recent_item_get_mime_type (item);
 #ifndef USE_STABLE_LIBGNOMEUI
 	{
 		int width, height;
-		gchar *uri;
+		gchar *mime_type;
+		
+		mime_type = egg_recent_item_get_mime_type (item);
 
 		gtk_icon_size_lookup_for_settings
 			(gtk_widget_get_settings (view->menu),
 			 view->icon_size,
 			 &width, &height);
 
-		uri = egg_recent_item_get_uri (item);
 		pixbuf = egg_recent_util_get_icon (view->theme, uri,
 						   mime_type,
 						   height);
-		g_free (uri);
+		g_free (mime_type);
 	}
 #else
 	pixbuf = NULL;
@@ -281,6 +285,24 @@
 	label = GTK_BIN (menu_item)->child;
 	gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
 	gtk_label_set_max_width_chars (GTK_LABEL (label), view->label_width);
+	
+	g_free (text);
+	
+	/* check if the item points to a still existing file, and if not we
+	 * make the menu item not sensitive; since this check is really
+	 * expensive, we do it only for local files.
+	 */
+	if (g_str_has_prefix (uri, "file://")) {
+		GnomeVFSURI *vfs_uri;
+		
+		vfs_uri = gnome_vfs_uri_new (uri);
+		
+		gtk_widget_set_sensitive (menu_item, gnome_vfs_uri_exists (vfs_uri));
+		
+		gnome_vfs_uri_unref (vfs_uri);
+	}
+
+	g_free (uri);
 
 	md = g_new0 (EggRecentViewGtkMenuData, 1);
 	md->view = view;
@@ -291,9 +313,6 @@
 			       md,
 			       (GClosureNotify)egg_recent_view_gtk_destroy_cb,
 			       0);
-
-	g_free (mime_type);
-	g_free (text);
 
 	/*
 	 * this is a tag so we can distinguish our menu items
