Commit 90799c2a authored by António Fernandes's avatar António Fernandes 🐚

bookmark-list: Disable bookmarking recent:// and trash://

These locations are listed in the sidebar already. Bookmarking duplicates them.

We already disable bookmarking Home, Favories, XDG User Firs, and Other Locations.

Do the same thing for Recent and Trash.
As a side effect, this will disable bookmarking child folders inside Trash.

Fixes: #189
parent 9238456b
......@@ -643,6 +643,16 @@ nautilus_bookmark_list_can_bookmark_location (NautilusBookmarkList *list,
return FALSE;
}
if (nautilus_is_recent_directory (location))
{
return FALSE;
}
if (nautilus_is_trash_directory (location))
{
return FALSE;
}
if (nautilus_is_favorite_directory (location))
{
return FALSE;
......
......@@ -539,6 +539,16 @@ nautilus_is_search_directory (GFile *dir)
return eel_uri_is_search (uri);
}
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)
{
......@@ -552,6 +562,15 @@ nautilus_is_favorite_directory (GFile *dir)
return FALSE;
}
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)
{
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment