Commit 2d08aa9d authored by Carlos Soriano 's avatar Carlos Soriano

Merge branch '189-recent-can-be-bookmarked' into 'master'

Resolve ""Recent" and "Trash" can be bookmarked"

Closes #189

See merge request !51
parents 9238456b 6c5f6ecc
Pipeline #1821 failed with stage
......@@ -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);
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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