[nautilus/wip/oholy/search-engine-fixes: 15/20] search-engine-recent: Do not include remote files
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/oholy/search-engine-fixes: 15/20] search-engine-recent: Do not include remote files
- Date: Sat, 5 Mar 2022 15:12:03 +0000 (UTC)
commit ac0a9f1630810b913a9ed9c50dbcd6c9b9641c41
Author: Ondrej Holy <oholy redhat com>
Date: Mon Feb 14 16:01:06 2022 +0100
search-engine-recent: Do not include remote files
The recent search engine provider also includes remote files. This
could lead to mount operations, which I think is not wanted. Let's
do not include remote files similarly to what the gvfs backend does.
Relates: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2152
src/nautilus-search-engine-recent.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/src/nautilus-search-engine-recent.c b/src/nautilus-search-engine-recent.c
index 27d10bb82..56eef85a3 100644
--- a/src/nautilus-search-engine-recent.c
+++ b/src/nautilus-search-engine-recent.c
@@ -232,27 +232,28 @@ recent_thread_func (gpointer user_data)
NautilusSearchHit *hit;
GDateTime *modified;
GDateTime *visited;
+ g_autoptr (GError) error = NULL;
- if (gtk_recent_info_is_local (info))
+ if (!gtk_recent_info_is_local (info))
{
- g_autoptr (GError) error = NULL;
+ continue;
+ }
- if (!is_file_valid_recursive (self, file, &error))
+ if (!is_file_valid_recursive (self, file, &error))
+ {
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
{
- 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);
- }
+ break;
+ }
- continue;
+ 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->len > 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]