diff options
-rw-r--r-- | eel/eel-vfs-extensions.h | 2 | ||||
-rw-r--r-- | src/nautilus-bookmark-list.c | 18 | ||||
-rw-r--r-- | src/nautilus-bookmark.c | 9 | ||||
-rw-r--r-- | src/nautilus-file-utilities.c | 19 | ||||
-rw-r--r-- | src/nautilus-file-utilities.h | 2 |
5 files changed, 31 insertions, 19 deletions
diff --git a/eel/eel-vfs-extensions.h b/eel/eel-vfs-extensions.h index d552a330a..69aa51088 100644 --- a/eel/eel-vfs-extensions.h +++ b/eel/eel-vfs-extensions.h @@ -36,8 +36,6 @@ G_BEGIN_DECLS gboolean eel_uri_is_favorites (const char *uri); gboolean eel_uri_is_trash (const char *uri); -gboolean eel_uri_is_trash_folder (const char *uri); -gboolean eel_uri_is_in_trash (const char *uri); gboolean eel_uri_is_search (const char *uri); gboolean eel_uri_is_other_locations (const char *uri); gboolean eel_uri_is_recent (const char *uri); diff --git a/src/nautilus-bookmark-list.c b/src/nautilus-bookmark-list.c index 926d949fe..4585fc742 100644 --- a/src/nautilus-bookmark-list.c +++ b/src/nautilus-bookmark-list.c @@ -625,11 +625,7 @@ nautilus_bookmark_list_can_bookmark_location (NautilusBookmarkList *list, if (nautilus_bookmark_list_item_with_location (list, location, NULL)) { - return FALSE; - } - - if (nautilus_is_home_directory (location)) - { + /* Already bookmarked */ return FALSE; } @@ -638,13 +634,13 @@ nautilus_bookmark_list_can_bookmark_location (NautilusBookmarkList *list, return FALSE; } - if (nautilus_is_other_locations_directory (location)) - { - return FALSE; - } - - if (nautilus_is_favorite_directory (location)) + if (nautilus_is_recent_directory (location) || + nautilus_is_favorite_directory (location) || + nautilus_is_home_directory (location) || + nautilus_is_trash_directory (location) || + nautilus_is_other_locations_directory (location)) { + /* Already in the sidebar */ return FALSE; } diff --git a/src/nautilus-bookmark.c b/src/nautilus-bookmark.c index 1b2e58003..6c731d42b 100644 --- a/src/nautilus-bookmark.c +++ b/src/nautilus-bookmark.c @@ -212,12 +212,9 @@ nautilus_bookmark_get_is_builtin (NautilusBookmark *bookmark) } /* exclude XDG locations which are not in our builtin list */ - if (xdg_type == G_USER_DIRECTORY_DESKTOP) - { - return FALSE; - } - - return (xdg_type != G_USER_DIRECTORY_TEMPLATES) && (xdg_type != G_USER_DIRECTORY_PUBLIC_SHARE); + return (xdg_type != G_USER_DIRECTORY_DESKTOP) && + (xdg_type != G_USER_DIRECTORY_TEMPLATES) && + (xdg_type != G_USER_DIRECTORY_PUBLIC_SHARE); } gboolean diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c index ba67b8559..55040aa91 100644 --- a/src/nautilus-file-utilities.c +++ b/src/nautilus-file-utilities.c @@ -540,6 +540,16 @@ nautilus_is_search_directory (GFile *dir) } gboolean +nautilus_is_recent_directory (GFile *dir) +{ + g_autofree gchar *uri = NULL; + + uri = g_file_get_uri (dir); + + return eel_uri_is_recent (uri); +} + +gboolean nautilus_is_favorite_directory (GFile *dir) { g_autofree gchar *uri = NULL; @@ -553,6 +563,15 @@ nautilus_is_favorite_directory (GFile *dir) } gboolean +nautilus_is_trash_directory (GFile *dir) +{ + g_autofree gchar *uri = NULL; + + uri = g_file_get_uri (dir); + return eel_uri_is_trash (uri); +} + +gboolean nautilus_is_other_locations_directory (GFile *dir) { g_autofree gchar *uri = NULL; diff --git a/src/nautilus-file-utilities.h b/src/nautilus-file-utilities.h index 415f01b3e..790c9bbf4 100644 --- a/src/nautilus-file-utilities.h +++ b/src/nautilus-file-utilities.h @@ -43,7 +43,9 @@ gboolean nautilus_is_home_directory_file (GFile *dir, const char *filename); gboolean nautilus_is_in_system_dir (GFile *location); gboolean nautilus_is_search_directory (GFile *dir); +gboolean nautilus_is_recent_directory (GFile *dir); gboolean nautilus_is_favorite_directory (GFile *dir); +gboolean nautilus_is_trash_directory (GFile *dir); gboolean nautilus_is_other_locations_directory (GFile *dir); GMount * nautilus_get_mounted_mount_for_root (GFile *location); |