[nautilus] search-engine-simple: get query parameters just once in a cycle
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] search-engine-simple: get query parameters just once in a cycle
- Date: Thu, 26 Jul 2018 05:48:45 +0000 (UTC)
commit 3fc6804eff5b49727ea69d5fe18dbaa979b65b7c
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Wed Jun 6 15:22:06 2018 +0200
search-engine-simple: get query parameters just once in a cycle
src/nautilus-search-engine-simple.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/nautilus-search-engine-simple.c b/src/nautilus-search-engine-simple.c
index 2b400ac4a..12fafb46e 100644
--- a/src/nautilus-search-engine-simple.c
+++ b/src/nautilus-search-engine-simple.c
@@ -208,6 +208,8 @@ static void
visit_directory (GFile *dir,
SearchThreadData *data)
{
+ g_autoptr (GPtrArray) date_range = NULL;
+ NautilusQuerySearchType type;
GFileEnumerator *enumerator;
GFileInfo *info;
GFile *child;
@@ -238,10 +240,11 @@ visit_directory (GFile *dir,
return;
}
+ type = nautilus_query_get_search_type (data->query);
+ date_range = nautilus_query_get_date_range (data->query);
+
while ((info = g_file_enumerator_next_file (enumerator, data->cancellable, NULL)) != NULL)
{
- g_autoptr (GPtrArray) date_range = NULL;
-
display_name = g_file_info_get_display_name (info);
if (display_name == NULL)
{
@@ -276,15 +279,12 @@ visit_directory (GFile *dir,
mtime = g_file_info_get_attribute_uint64 (info, "time::modified");
atime = g_file_info_get_attribute_uint64 (info, "time::access");
- date_range = nautilus_query_get_date_range (data->query);
if (found && date_range != NULL)
{
- NautilusQuerySearchType type;
guint64 current_file_time;
initial_date = g_ptr_array_index (date_range, 0);
end_date = g_ptr_array_index (date_range, 1);
- type = nautilus_query_get_search_type (data->query);
if (type == NAUTILUS_QUERY_SEARCH_TYPE_LAST_ACCESS)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]