summaryrefslogtreecommitdiff
path: root/libnautilus-private
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-09-03 15:51:14 +0200
committerCarlos Soriano <csoriano@gnome.org>2015-09-03 16:18:13 +0200
commitbbc175eb49e07106f0b3d4b3482e9c704ddef8b0 (patch)
tree7cf98791d8f057892c1647e48a24e2c39aa6de8b /libnautilus-private
parentcd0d78a6b5bcfc977e2921278487aeef44f94512 (diff)
downloadnautilus-bbc175eb49e07106f0b3d4b3482e9c704ddef8b0.tar.gz
search: be more robust to peek is remote
Few fixes to be more robust and correct when checking if a file or directory is remote.
Diffstat (limited to 'libnautilus-private')
-rw-r--r--libnautilus-private/nautilus-directory.c11
-rw-r--r--libnautilus-private/nautilus-file.c6
-rw-r--r--libnautilus-private/nautilus-search-directory.c2
3 files changed, 16 insertions, 3 deletions
diff --git a/libnautilus-private/nautilus-directory.c b/libnautilus-private/nautilus-directory.c
index fad84c9b5..75f70f97c 100644
--- a/libnautilus-private/nautilus-directory.c
+++ b/libnautilus-private/nautilus-directory.c
@@ -615,6 +615,7 @@ nautilus_directory_is_remote (NautilusDirectory *directory)
{
GFileInfo *info;
gboolean is_remote;
+ GError *error = NULL;
g_assert (NAUTILUS_IS_DIRECTORY (directory));
@@ -623,7 +624,15 @@ nautilus_directory_is_remote (NautilusDirectory *directory)
}
info = g_file_query_filesystem_info (directory->details->location, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE,
- NULL, NULL);
+ NULL, &error);
+ if (error) {
+ /* Custom schemas like x-nautilus-desktop or other-locations:///
+ * should not yell warnings */
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED))
+ g_warning ("Can't peek the uri: %s filesystem type with error: %s",
+ g_file_get_uri (directory->details->location), error->message);
+ }
+ g_clear_error (&error);
if (info) {
const gchar *type;
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 1d36b088a..6807cad3b 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -7012,7 +7012,11 @@ nautilus_file_is_remote (NautilusFile *file)
{
g_assert (NAUTILUS_IS_FILE (file));
- return nautilus_directory_is_remote (file->details->directory);
+ if (nautilus_file_is_directory (file))
+ return nautilus_directory_is_remote (nautilus_directory_get_for_file (file));
+ else
+ return nautilus_directory_is_remote (file->details->directory);
+
}
/**
diff --git a/libnautilus-private/nautilus-search-directory.c b/libnautilus-private/nautilus-search-directory.c
index 86cf2bf4e..5de492fad 100644
--- a/libnautilus-private/nautilus-search-directory.c
+++ b/libnautilus-private/nautilus-search-directory.c
@@ -188,7 +188,7 @@ start_search (NautilusSearchDirectory *search)
/* It's too slow to search recursively on locations that are on the network. So
* for that case, just search in the current directory */
recursive = g_settings_get_boolean (nautilus_preferences, "enable-recursive-search") &&
- !nautilus_file_is_remote (directory_as_file);
+ !nautilus_directory_is_remote (search->details->base_model);
g_object_unref (directory_as_file);
g_object_set (simple_provider, "recursive", recursive, NULL);