mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-27 11:29:24 +00:00
nautilus-toolbar: disable bookmark on 'Other Locations'
'Other locations' is already listed in the sidebar. So there is no need for allowing the user to bookmark 'Other Locations'. This commit makes the bookmark button in toolbar insensitive for 'Other Locations'. https://bugzilla.gnome.org/show_bug.cgi?id=771163
This commit is contained in:
parent
7a4a5b0325
commit
3c8d450cd6
|
@ -55,6 +55,12 @@ eel_uri_is_search (const char *uri)
|
|||
return g_str_has_prefix (uri, EEL_SEARCH_URI);
|
||||
}
|
||||
|
||||
gboolean
|
||||
eel_uri_is_other_locations (const char *uri)
|
||||
{
|
||||
return g_str_has_prefix (uri, "other-locations:");
|
||||
}
|
||||
|
||||
gboolean
|
||||
eel_uri_is_desktop (const char *uri)
|
||||
{
|
||||
|
|
|
@ -40,6 +40,7 @@ gboolean eel_uri_is_trash_folder (const char *
|
|||
gboolean eel_uri_is_in_trash (const char *uri);
|
||||
gboolean eel_uri_is_desktop (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);
|
||||
|
||||
char * eel_make_valid_utf8 (const char *name);
|
||||
|
|
|
@ -629,6 +629,11 @@ nautilus_bookmark_list_can_bookmark_location (NautilusBookmarkList *list,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (nautilus_is_other_locations_directory (location))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bookmark = nautilus_bookmark_new (location, NULL);
|
||||
is_builtin = nautilus_bookmark_get_is_builtin (bookmark);
|
||||
g_object_unref (bookmark);
|
||||
|
|
|
@ -592,6 +592,15 @@ nautilus_is_search_directory (GFile *dir)
|
|||
return eel_uri_is_search (uri);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nautilus_is_other_locations_directory (GFile *dir)
|
||||
{
|
||||
g_autofree gchar *uri = NULL;
|
||||
|
||||
uri = g_file_get_uri (dir);
|
||||
return eel_uri_is_other_locations (uri);
|
||||
}
|
||||
|
||||
GMount *
|
||||
nautilus_get_mounted_mount_for_root (GFile *location)
|
||||
{
|
||||
|
|
|
@ -46,6 +46,7 @@ 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_other_locations_directory (GFile *dir);
|
||||
GMount * nautilus_get_mounted_mount_for_root (GFile *location);
|
||||
|
||||
gboolean nautilus_should_use_templates_directory (void);
|
||||
|
|
Loading…
Reference in a new issue