[nautilus] search-directory: set show hidden files on query according to monitors
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] search-directory: set show hidden files on query according to monitors
- Date: Mon, 15 Oct 2012 14:03:38 +0000 (UTC)
commit 9703e67f576735d0ad6bdf3c7ca04e5c6efcc17d
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sat Oct 13 17:20:00 2012 -0400
search-directory: set show hidden files on query according to monitors
This ensures the simple engine won't crawl in hidden directories, unless
necessary.
libnautilus-private/nautilus-query.c | 5 +++--
libnautilus-private/nautilus-search-directory.c | 20 ++++++++++++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/libnautilus-private/nautilus-query.c b/libnautilus-private/nautilus-query.c
index 6f457d8..2b78213 100644
--- a/libnautilus-private/nautilus-query.c
+++ b/libnautilus-private/nautilus-query.c
@@ -24,10 +24,11 @@
#include <config.h>
#include <string.h>
-#include "nautilus-query.h"
#include <eel/eel-glib-extensions.h>
#include <glib/gi18n.h>
-#include <libnautilus-private/nautilus-file-utilities.h>
+
+#include "nautilus-file-utilities.h"
+#include "nautilus-query.h"
struct NautilusQueryDetails {
char *text;
diff --git a/libnautilus-private/nautilus-search-directory.c b/libnautilus-private/nautilus-search-directory.c
index 47e987c..984c78f 100644
--- a/libnautilus-private/nautilus-search-directory.c
+++ b/libnautilus-private/nautilus-search-directory.c
@@ -122,6 +122,25 @@ reset_file_list (NautilusSearchDirectory *search)
}
static void
+set_hidden_files (NautilusSearchDirectory *search)
+{
+ GList *l;
+ SearchMonitor *monitor;
+ gboolean monitor_hidden = FALSE;
+
+ for (l = search->details->monitor_list; l != NULL; l = l->next) {
+ monitor = l->data;
+ monitor_hidden |= monitor->monitor_hidden_files;
+
+ if (monitor_hidden) {
+ break;
+ }
+ }
+
+ nautilus_query_set_show_hidden_files (search->details->query, monitor_hidden);
+}
+
+static void
start_search (NautilusSearchDirectory *search)
{
NautilusSearchEngineModel *model_provider;
@@ -142,6 +161,7 @@ start_search (NautilusSearchDirectory *search)
search->details->search_running = TRUE;
search->details->search_finished = FALSE;
+ set_hidden_files (search);
nautilus_search_provider_set_query (NAUTILUS_SEARCH_PROVIDER (search->details->engine),
search->details->query);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]