[nautilus/wip/gbsneto/search-popover: 5/8] search-directory: use the query's recursive flag



commit fbdf4e2fb0d06cd7581045cfd7bca93985cfdda3
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Jan 12 20:35:07 2016 -0200

    search-directory: use the query's recursive flag
    
    NautilusSearchDirectory decides whether the search
    will be done recursively or not by manually checking
    if the current directory is remote or not.
    
    Since the NautilusQuery::recursive flag already does
    this job through NautilusQueryEditor, the manual check
    is obsolete.
    
    Fix that by using the query's recursive flag instead.

 libnautilus-private/nautilus-search-directory.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/libnautilus-private/nautilus-search-directory.c b/libnautilus-private/nautilus-search-directory.c
index 10b5525..f861906 100644
--- a/libnautilus-private/nautilus-search-directory.c
+++ b/libnautilus-private/nautilus-search-directory.c
@@ -26,7 +26,6 @@
 #include "nautilus-file.h"
 #include "nautilus-file-private.h"
 #include "nautilus-file-utilities.h"
-#include "nautilus-global-preferences.h"
 #include "nautilus-search-provider.h"
 #include "nautilus-search-engine.h"
 #include "nautilus-search-engine-model.h"
@@ -157,7 +156,6 @@ start_search (NautilusSearchDirectory *search)
 {
        NautilusSearchEngineModel *model_provider;
        NautilusSearchEngineSimple *simple_provider;
-        NautilusFile *directory_as_file;
        gboolean recursive;
 
        if (!search->details->query) {
@@ -184,12 +182,7 @@ start_search (NautilusSearchDirectory *search)
        nautilus_search_engine_model_set_model (model_provider, search->details->base_model);
 
        simple_provider = nautilus_search_engine_get_simple_provider (search->details->engine);
-        directory_as_file = nautilus_directory_get_corresponding_file (search->details->base_model);
-        /* It's too slow to search recursively on locations that are on the network. So
-         * for that case, just search in the current directory */
-       recursive = g_settings_get_boolean (nautilus_preferences, "enable-recursive-search") &&
-                    !nautilus_directory_is_remote (search->details->base_model);
-        g_object_unref (directory_as_file);
+       recursive = nautilus_query_get_recursive (search->details->query);
        g_object_set (simple_provider, "recursive", recursive, NULL);
 
        reset_file_list (search);


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