[nautilus/wip/antoniof/local_vs_native_fixup: 76/90] file-utilities: Drop nautilus_file_system_is_remote
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/local_vs_native_fixup: 76/90] file-utilities: Drop nautilus_file_system_is_remote
- Date: Mon, 25 Jan 2021 10:54:13 +0000 (UTC)
commit f0759d6fe9bb405c3e9a5a5cf2e9509514f4eb6f
Author: António Fernandes <antoniof gnome org>
Date: Sat Dec 12 20:56:13 2020 +0000
file-utilities: Drop nautilus_file_system_is_remote
It compares the filesystem type identifier with a hardcoded list of
remote types introduced in 2015.[0]
The filesystem::remote attribute has been introduced[1] to handle this,
and we have been using it[2], but kept the hardcoded list in order to
workaround issues with GLocalFile not setting this attribute correctly.
Now that these issues have been fixed[3], we can finally drop it.
[0] d3e1a71c6377343af5d61d6ded7bc4f53dfeaf53
[1] https://gitlab.gnome.org/GNOME/glib/-/commit/e57355b055217b067cd1a71340f7ea47e51d4aae
[2] 99f55748ef69a68df86b9a039998ee576d59b898
[3] https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1534
src/nautilus-file-utilities.c | 18 ------------------
src/nautilus-file-utilities.h | 2 --
src/nautilus-file.c | 11 +----------
src/nautilus-search-engine.c | 10 +++-------
4 files changed, 4 insertions(+), 37 deletions(-)
---
diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c
index a3cc97b83..62d8d70bb 100644
--- a/src/nautilus-file-utilities.c
+++ b/src/nautilus-file-utilities.c
@@ -1485,21 +1485,3 @@ location_settings_search_get_recursive_for_location (GFile *location)
return recursive;
}
-
-gboolean
-nautilus_file_system_is_remote (const char *file_system)
-{
- static const gchar * const remote_types[] =
- {
- "afp",
- "google-drive",
- "sftp",
- "webdav",
- "ftp",
- "nfs",
- "cifs",
- NULL
- };
-
- return file_system != NULL && g_strv_contains (remote_types, file_system);
-}
diff --git a/src/nautilus-file-utilities.h b/src/nautilus-file-utilities.h
index 22d851c1b..67df0e4d9 100644
--- a/src/nautilus-file-utilities.h
+++ b/src/nautilus-file-utilities.h
@@ -141,5 +141,3 @@ gchar * nautilus_uri_to_native_uri (const gchar *uri);
NautilusQueryRecursive location_settings_search_get_recursive (void);
NautilusQueryRecursive location_settings_search_get_recursive_for_location (GFile *location);
-
-gboolean nautilus_file_system_is_remote (const char *file_system);
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index b0dca1e3c..243470432 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -8157,18 +8157,9 @@ nautilus_file_is_in_starred (NautilusFile *file)
gboolean
nautilus_file_is_remote (NautilusFile *file)
{
- g_autofree char *filesystem_type = NULL;
-
g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE);
- if (nautilus_file_get_filesystem_remote (file))
- {
- return TRUE;
- }
-
- filesystem_type = nautilus_file_get_filesystem_type (file);
-
- return nautilus_file_system_is_remote (filesystem_type);
+ return nautilus_file_get_filesystem_remote (file);
}
/**
diff --git a/src/nautilus-search-engine.c b/src/nautilus-search-engine.c
index c8505e594..e30f6e007 100644
--- a/src/nautilus-search-engine.c
+++ b/src/nautilus-search-engine.c
@@ -572,16 +572,12 @@ is_recursive_search (NautilusSearchEngineType engine_type,
g_autoptr (GFileInfo) file_system_info = NULL;
file_system_info = g_file_query_filesystem_info (location,
- G_FILE_ATTRIBUTE_FILESYSTEM_TYPE,
+ G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE,
NULL, NULL);
if (file_system_info != NULL)
{
- const char *file_system;
-
- file_system = g_file_info_get_attribute_string (file_system_info,
- G_FILE_ATTRIBUTE_FILESYSTEM_TYPE);
-
- return !nautilus_file_system_is_remote (file_system);
+ return !g_file_info_get_attribute_boolean (file_system_info,
+ G_FILE_ATTRIBUTE_FILESYSTEM_REMOTE);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]