[PATCH] Don't display nonexistant bookmark locations in sidebar/bookmark menu



Reported as bug 312507 [1]. File chooser inconsistency.
Proposed patch attached.

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

-- 
Christian Neumair <chris gnome-de org>
Index: src/nautilus-places-sidebar.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-places-sidebar.c,v
retrieving revision 1.5
diff -u -p -r1.5 nautilus-places-sidebar.c
--- src/nautilus-places-sidebar.c	11 Jul 2005 10:12:46 -0000	1.5
+++ src/nautilus-places-sidebar.c	7 Oct 2005 00:05:48 -0000
@@ -213,6 +213,10 @@ update_places (NautilusPlacesSidebar *si
 	for (index = 0; index < bookmark_count; ++index) {
 		bookmark = nautilus_bookmark_list_item_at (sidebar->bookmarks, index);
 
+		if (nautilus_bookmark_uri_known_not_to_exist (bookmark)) {
+			continue;
+		}
+
 		name = nautilus_bookmark_get_name (bookmark);
 		icon = nautilus_bookmark_get_icon (bookmark);
 		mount_uri = nautilus_bookmark_get_uri (bookmark);
Index: src/nautilus-window-bookmarks.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-bookmarks.c,v
retrieving revision 1.1
diff -u -p -r1.1 nautilus-window-bookmarks.c
--- src/nautilus-window-bookmarks.c	23 Jun 2005 14:16:58 -0000	1.1
+++ src/nautilus-window-bookmarks.c	7 Oct 2005 00:05:48 -0000
@@ -202,6 +202,7 @@ static void
 update_bookmarks (NautilusWindow *window)
 {
         NautilusBookmarkList *bookmarks;
+	NautilusBookmark *bookmark;
 	guint bookmark_count;
 	guint index;
 	GtkUIManager *ui_manager;
@@ -225,9 +226,15 @@ update_bookmarks (NautilusWindow *window
 	/* append new set of bookmarks */
 	bookmark_count = nautilus_bookmark_list_length (bookmarks);
 	for (index = 0; index < bookmark_count; ++index) {
+		bookmark = nautilus_bookmark_list_item_at (bookmarks, index);
+
+		if (nautilus_bookmark_uri_known_not_to_exist (bookmark)) {
+			continue;
+		}
+
 		nautilus_menus_append_bookmark_to_menu
-			(NAUTILUS_WINDOW (window), 
-			 nautilus_bookmark_list_item_at (bookmarks, index),
+			(NAUTILUS_WINDOW (window),
+			 bookmark,
 			 NAUTILUS_WINDOW_GET_CLASS (window)->bookmarks_placeholder,
 			 "dynamic",
 			 index,

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]