[nautilus] nautilus-toolbar: disable bookmark on 'Other Locations'
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] nautilus-toolbar: disable bookmark on 'Other Locations'
- Date: Wed, 21 Sep 2016 08:24:34 +0000 (UTC)
commit 3c8d450cd61a891a84fb4b2c06f4cc6a806a260d
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Wed Sep 21 08:31:42 2016 +0530
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
eel/eel-vfs-extensions.c | 6 ++++++
eel/eel-vfs-extensions.h | 1 +
src/nautilus-bookmark-list.c | 5 +++++
src/nautilus-file-utilities.c | 9 +++++++++
src/nautilus-file-utilities.h | 1 +
5 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/eel/eel-vfs-extensions.c b/eel/eel-vfs-extensions.c
index 49e4b00..8bb33f7 100644
--- a/eel/eel-vfs-extensions.c
+++ b/eel/eel-vfs-extensions.c
@@ -56,6 +56,12 @@ eel_uri_is_search (const char *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)
{
return g_str_has_prefix (uri, EEL_DESKTOP_URI);
diff --git a/eel/eel-vfs-extensions.h b/eel/eel-vfs-extensions.h
index f64af0a..8336efe 100644
--- a/eel/eel-vfs-extensions.h
+++ b/eel/eel-vfs-extensions.h
@@ -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);
diff --git a/src/nautilus-bookmark-list.c b/src/nautilus-bookmark-list.c
index 839b6a5..bdcb6e9 100644
--- a/src/nautilus-bookmark-list.c
+++ b/src/nautilus-bookmark-list.c
@@ -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);
diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c
index c6f6641..9a6683e 100644
--- a/src/nautilus-file-utilities.c
+++ b/src/nautilus-file-utilities.c
@@ -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)
{
diff --git a/src/nautilus-file-utilities.h b/src/nautilus-file-utilities.h
index c4d863f..bd6c06c 100644
--- a/src/nautilus-file-utilities.h
+++ b/src/nautilus-file-utilities.h
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]