[PATCH] Prevent nautilus bookmark from changing when trashing a file



Details on bug available under [1].

[1] http://bugzilla.gnome.org/show_bug.cgi?id=162787

-- 
Christian Neumair <chris gnome-de org>
Index: libnautilus-private/nautilus-bookmark.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-bookmark.c,v
retrieving revision 1.64
diff -u -p -r1.64 nautilus-bookmark.c
--- libnautilus-private/nautilus-bookmark.c	23 Jun 2005 08:27:27 -0000	1.64
+++ libnautilus-private/nautilus-bookmark.c	15 Oct 2005 15:33:56 -0000
@@ -353,7 +353,8 @@ bookmark_file_changed_callback (Nautilus
 	should_emit_contents_changed_signal = FALSE;
 	file_uri = nautilus_file_get_uri (file);
 
-	if (!gnome_vfs_uris_match (bookmark->details->uri, file_uri)) {
+	if (!gnome_vfs_uris_match (bookmark->details->uri, file_uri) &&
+	    !nautilus_file_is_in_trash (file)) {
 		g_free (bookmark->details->uri);
 		bookmark->details->uri = file_uri;
 		should_emit_contents_changed_signal = TRUE;
@@ -361,8 +362,9 @@ bookmark_file_changed_callback (Nautilus
 		g_free (file_uri);
 	}
 
-	if (nautilus_file_is_gone (file)) {
-		/* The file we were monitoring has been deleted,
+	if (nautilus_file_is_gone (file) ||
+	    nautilus_file_is_in_trash (file)) {
+		/* The file we were monitoring has been trashed, deleted,
 		 * or moved in a way that we didn't notice. Make 
 		 * a spanking new NautilusFile object for this 
 		 * location so if a new file appears in this place 

Attachment: signature.asc
Description: This is a digitally signed message part



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