diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-06-18 22:44:11 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-06-18 22:59:44 -0400 |
commit | a3a58fa7d9997c2296f7bcfed6169f6b936cb8d1 (patch) | |
tree | 0093923f9bc6e6d225bfc3979a24baeb24476490 /gtk/gtksearchenginesimple.c | |
parent | 15a41e0bf587b370c52044f12c33e4fae3a76f17 (diff) | |
download | gtk+-a3a58fa7d9997c2296f7bcfed6169f6b936cb8d1.tar.gz |
GtkSearchEngine: Add recursive flag
Add a flag for recursive search, and implement non-recursive
search in both the tracker and simple search engines.
This is not currently used in the file chooser.
Diffstat (limited to 'gtk/gtksearchenginesimple.c')
-rw-r--r-- | gtk/gtksearchenginesimple.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk/gtksearchenginesimple.c b/gtk/gtksearchenginesimple.c index fc33c4ba27..769dd04dc2 100644 --- a/gtk/gtksearchenginesimple.c +++ b/gtk/gtksearchenginesimple.c @@ -43,6 +43,7 @@ typedef struct GList *hits; GtkQuery *query; + gboolean recursive; } SearchThreadData; @@ -95,6 +96,7 @@ search_thread_data_new (GtkSearchEngineSimple *engine, data->engine = g_object_ref (engine); data->directories = g_queue_new (); data->query = g_object_ref (query); + data->recursive = _gtk_search_engine_get_recursive (GTK_SEARCH_ENGINE (engine)); uri = gtk_query_get_location (query); if (uri != NULL) location = g_file_new_for_uri (uri); @@ -225,7 +227,7 @@ visit_directory (GFile *dir, SearchThreadData *data) if (data->n_processed_files > BATCH_SIZE) send_batch (data); - if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) + if (data->recursive && g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) g_queue_push_tail (data->directories, g_object_ref (child)); } |