diff options
Diffstat (limited to 'libnautilus-private')
-rw-r--r-- | libnautilus-private/nautilus-query.c | 14 | ||||
-rw-r--r-- | libnautilus-private/nautilus-query.h | 3 | ||||
-rw-r--r-- | libnautilus-private/nautilus-search-engine-simple.c | 7 |
3 files changed, 23 insertions, 1 deletions
diff --git a/libnautilus-private/nautilus-query.c b/libnautilus-private/nautilus-query.c index 59d94f4b9..6f457d824 100644 --- a/libnautilus-private/nautilus-query.c +++ b/libnautilus-private/nautilus-query.c @@ -33,6 +33,7 @@ struct NautilusQueryDetails { char *text; char *location_uri; GList *mime_types; + gboolean show_hidden; }; static void nautilus_query_class_init (NautilusQueryClass *class); @@ -68,6 +69,7 @@ nautilus_query_init (NautilusQuery *query) { query->details = G_TYPE_INSTANCE_GET_PRIVATE (query, NAUTILUS_TYPE_QUERY, NautilusQueryDetails); + query->details->show_hidden = TRUE; } NautilusQuery * @@ -123,6 +125,18 @@ nautilus_query_add_mime_type (NautilusQuery *query, const char *mime_type) g_strdup (mime_type)); } +gboolean +nautilus_query_get_show_hidden_files (NautilusQuery *query) +{ + return query->details->show_hidden; +} + +void +nautilus_query_set_show_hidden_files (NautilusQuery *query, gboolean show_hidden) +{ + query->details->show_hidden = show_hidden; +} + char * nautilus_query_to_readable_string (NautilusQuery *query) { diff --git a/libnautilus-private/nautilus-query.h b/libnautilus-private/nautilus-query.h index 9507cdbe5..4c2e52bca 100644 --- a/libnautilus-private/nautilus-query.h +++ b/libnautilus-private/nautilus-query.h @@ -51,6 +51,9 @@ NautilusQuery* nautilus_query_new (void); char * nautilus_query_get_text (NautilusQuery *query); void nautilus_query_set_text (NautilusQuery *query, const char *text); +gboolean nautilus_query_get_show_hidden_files (NautilusQuery *query); +void nautilus_query_set_show_hidden_files (NautilusQuery *query, gboolean show_hidden); + char * nautilus_query_get_location (NautilusQuery *query); void nautilus_query_set_location (NautilusQuery *query, const char *uri); diff --git a/libnautilus-private/nautilus-search-engine-simple.c b/libnautilus-private/nautilus-search-engine-simple.c index 7ee4917da..0a52dac03 100644 --- a/libnautilus-private/nautilus-search-engine-simple.c +++ b/libnautilus-private/nautilus-search-engine-simple.c @@ -210,7 +210,7 @@ visit_directory (GFile *dir, SearchThreadData *data) GFile *child; const char *mime_type, *display_name; char *prepared; - gboolean found; + gboolean found, is_hidden; int i; GList *l; const char *id; @@ -235,6 +235,11 @@ visit_directory (GFile *dir, SearchThreadData *data) goto next; } + is_hidden = g_file_info_get_is_hidden (info) || g_file_info_get_is_backup (info); + if (is_hidden && !nautilus_query_get_show_hidden_files (data->engine->details->query)) { + goto next; + } + prepared = nautilus_search_prepare_string_for_compare (display_name); found = TRUE; |