summaryrefslogtreecommitdiff
path: root/src/nautilus-file.c
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2020-05-11 12:57:42 +0100
committerOndrej Holy <oholy@redhat.com>2021-01-25 10:54:11 +0000
commit15df18b1daa810ae5a694bd56b36c70c06a6da30 (patch)
tree5c2ae1f6d8c83606ff60d73f8033173bd94df23e /src/nautilus-file.c
parent998e667a58df59d275ad8ec49d7fae42d6732a38 (diff)
downloadnautilus-15df18b1daa810ae5a694bd56b36c70c06a6da30.tar.gz
file,directory: Drop obsolete is_local() methodswip/antoniof/local_vs_native_fixup
They are plain wrappers for g_file_is_native(), and, after the previous commits, there are only two usages, which are found in: * window-slot.c, introduced in b3a4eabf01a57b860ea95155f608f33fd08cce27 * files-view.c, introduced in f98d2edb0a71c58127e23a05d58bd12842b57132 In both cases, we can just call g_file_is_native() directly. This way, we can drop the chronically-misinterpretted is_local() methods, whose various interpretations are now covered by specific checking methods: * g_file_is_native() * nautilus_file_has_local_path() * !nautilus_file_is_remote()
Diffstat (limited to 'src/nautilus-file.c')
-rw-r--r--src/nautilus-file.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 8e62d636a..124dc0287 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -2364,14 +2364,6 @@ nautilus_file_compare_location (NautilusFile *file_1,
return (gint) res;
}
-gboolean
-nautilus_file_is_local (NautilusFile *file)
-{
- g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE);
-
- return nautilus_directory_is_local (file->details->directory);
-}
-
/**
* nautilus_file_has_local_path:
*
@@ -6021,10 +6013,13 @@ nautilus_file_can_get_permissions (NautilusFile *file)
gboolean
nautilus_file_can_set_permissions (NautilusFile *file)
{
+ g_autoptr (GFile) location = NULL;
uid_t user_id;
+ location = nautilus_file_get_location (file);
+
if (file->details->uid != -1 &&
- nautilus_file_is_local (file))
+ g_file_is_native (location))
{
/* Check the user. */
user_id = geteuid ();