summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-10-22 14:43:18 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2012-10-22 15:24:21 -0400
commit17a85b78acc78b573c2e1776b348ed348e19adb7 (patch)
tree68340972ae1773990cd3ad1af66fc1318ac9986a
parent8e6f68afb117f13c4ba3528aa03e9fab14a1e1e9 (diff)
downloadnautilus-17a85b78acc78b573c2e1776b348ed348e19adb7.tar.gz
places-sidebar: don't add non-existent XDG bookmarks
If an XDG bookmark has been removed from ~/.config/user-dirs.dirs, or if its entry there points to an invalid directory, don't add it to the places sidebar. https://bugzilla.gnome.org/show_bug.cgi?id=645054
-rw-r--r--src/nautilus-places-sidebar.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c
index 55883e07d..fec0e9144 100644
--- a/src/nautilus-places-sidebar.c
+++ b/src/nautilus-places-sidebar.c
@@ -416,6 +416,7 @@ add_special_dirs (NautilusPlacesSidebar *sidebar)
char *name;
char *mount_uri;
char *tooltip;
+ NautilusBookmark *bookmark;
if (index == G_USER_DIRECTORY_DESKTOP ||
index == G_USER_DIRECTORY_TEMPLATES ||
@@ -438,6 +439,16 @@ add_special_dirs (NautilusPlacesSidebar *sidebar)
root = g_file_new_for_path (path);
name = g_file_get_basename (root);
icon = nautilus_special_directory_get_symbolic_icon (index);
+
+ /* Don't add the bookmark to the sidebar if it was removed from
+ * the user dir list, or if its location doesn't exist.
+ */
+ bookmark = nautilus_bookmark_list_item_with_location (sidebar->bookmarks, root, &idx);
+ if (bookmark && !nautilus_bookmark_get_exists (bookmark)) {
+ g_object_unref (root);
+ continue;
+ }
+
mount_uri = g_file_get_uri (root);
tooltip = g_file_get_parse_name (root);