[nautilus] search-engine-recent: only do IO operations if name comparision matches
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] search-engine-recent: only do IO operations if name comparision matches
- Date: Wed, 28 Nov 2018 12:52:07 +0000 (UTC)
commit e076ab0bd174635bfb785e129cfc92744f63dacb
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date: Wed Oct 24 13:38:37 2018 +0200
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.
src/nautilus-search-engine-recent.c | 44 ++++++++++++++++++-------------------
1 file 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]