[nautilus] bookmarks: don't allow bookmarking search



commit 15524454beebaaa08fdf08e4b06fa4bf8c095cc6
Author: Carlos Soriano <csoriano gnome org>
Date:   Tue Mar 29 15:08:38 2016 +0200

    bookmarks: don't allow bookmarking search
    
    With the latest redesign of the search, there is not much point to
    bookmark a search, and instead, make the search again.
    
    Anyway, maybe it makes sense if we create a more complex search engine,
    but we can add support for it in the future, when it's needed.

 libnautilus-private/nautilus-file-utilities.c |   10 ++++++++++
 libnautilus-private/nautilus-file-utilities.h |    1 +
 src/nautilus-bookmark-list.c                  |    4 ++++
 3 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-utilities.c b/libnautilus-private/nautilus-file-utilities.c
index 952d010..e8def7f 100644
--- a/libnautilus-private/nautilus-file-utilities.c
+++ b/libnautilus-private/nautilus-file-utilities.c
@@ -35,6 +35,7 @@
 #include <eel/eel-stock-dialogs.h>
 #include <eel/eel-string.h>
 #include <eel/eel-debug.h>
+#include <eel/eel-vfs-extensions.h>
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
@@ -523,6 +524,15 @@ nautilus_is_desktop_directory (GFile *dir)
        return g_file_equal (dir, desktop_dir);
 }
 
+gboolean
+nautilus_is_search_directory (GFile *dir)
+{
+        g_autofree gchar *uri = NULL;
+
+        uri = g_file_get_uri (dir);
+        return eel_uri_is_search (uri);
+}
+
 GMount *
 nautilus_get_mounted_mount_for_root (GFile *location)
 {
diff --git a/libnautilus-private/nautilus-file-utilities.h b/libnautilus-private/nautilus-file-utilities.h
index d3016df..5e1f283 100644
--- a/libnautilus-private/nautilus-file-utilities.h
+++ b/libnautilus-private/nautilus-file-utilities.h
@@ -46,6 +46,7 @@ gboolean nautilus_is_home_directory                  (GFile *dir);
 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);
 GMount * nautilus_get_mounted_mount_for_root         (GFile *location);
 
 gboolean nautilus_should_use_templates_directory     (void);
diff --git a/src/nautilus-bookmark-list.c b/src/nautilus-bookmark-list.c
index b62414a..e011254 100644
--- a/src/nautilus-bookmark-list.c
+++ b/src/nautilus-bookmark-list.c
@@ -569,6 +569,10 @@ nautilus_bookmark_list_can_bookmark_location (NautilusBookmarkList *list,
                return FALSE;
        }
 
+       if (nautilus_is_search_directory (location)) {
+               return FALSE;
+       }
+
        bookmark = nautilus_bookmark_new (location, NULL);
        is_builtin = nautilus_bookmark_get_is_builtin (bookmark);
        g_object_unref (bookmark);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]