summaryrefslogtreecommitdiff
path: root/src/nautilus-search-engine-recent.c
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2018-10-24 13:38:37 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2018-11-27 15:24:57 -0500
commite076ab0bd174635bfb785e129cfc92744f63dacb (patch)
treea5bb0d5f25c68f7aa5dcc8878dd917b1265f09bc /src/nautilus-search-engine-recent.c
parent9ea71a9a4231faa705fe3249cccfbdc80a94f73e (diff)
downloadnautilus-e076ab0bd174635bfb785e129cfc92744f63dacb.tar.gz
search-engine-recent: only do IO operations if name comparision matches
Avoid to do more expensive IO operations on a file if its name does not matches the query. Those computations are quicker than IO ops, thus better to delay them.
Diffstat (limited to 'src/nautilus-search-engine-recent.c')
-rw-r--r--src/nautilus-search-engine-recent.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/nautilus-search-engine-recent.c b/src/nautilus-search-engine-recent.c
index 3e4be37d2..2810b5575 100644
--- a/src/nautilus-search-engine-recent.c
+++ b/src/nautilus-search-engine-recent.c
@@ -213,28 +213,6 @@ recent_thread_func (gpointer user_data)
continue;
}
- if (gtk_recent_info_is_local (info))
- {
- g_autoptr (GError) error = NULL;
-
- if (!is_file_valid_recursive (self, file, &error))
- {
- if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- {
- break;
- }
-
- if (error != NULL &&
- !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS))
- {
- g_debug("Impossible to read recent file info: %s",
- error->message);
- }
-
- continue;
- }
- }
-
if (g_cancellable_is_cancelled (self->cancellable))
{
break;
@@ -256,6 +234,28 @@ recent_thread_func (gpointer user_data)
g_autoptr (GDateTime) gmodified = NULL;
g_autoptr (GDateTime) gvisited = NULL;
+ if (gtk_recent_info_is_local (info))
+ {
+ g_autoptr (GError) error = NULL;
+
+ if (!is_file_valid_recursive (self, file, &error))
+ {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ {
+ break;
+ }
+
+ if (error != NULL &&
+ !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS))
+ {
+ g_debug ("Impossible to read recent file info: %s",
+ error->message);
+ }
+
+ continue;
+ }
+ }
+
if (mime_types)
{
GList *ml;