diff options
author | António Fernandes <antoniof@gnome.org> | 2020-05-17 00:53:41 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2021-01-25 10:54:11 +0000 |
commit | 998e667a58df59d275ad8ec49d7fae42d6732a38 (patch) | |
tree | 3fb12e45a703120fcadd054d234d061c905c63ee /src | |
parent | b92a7d5232667ed2958df3db8cdb75d8a28d0ba3 (diff) | |
download | nautilus-998e667a58df59d275ad8ec49d7fae42d6732a38.tar.gz |
file: Rename and document has_local_path() method
The new name better reflects the usage and meaning of this method.
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-file.c | 14 | ||||
-rw-r--r-- | src/nautilus-file.h | 2 | ||||
-rw-r--r-- | src/nautilus-files-view.c | 4 | ||||
-rw-r--r-- | src/nautilus-mime-actions.c | 2 |
4 files changed, 17 insertions, 5 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c index 817241a21..8e62d636a 100644 --- a/src/nautilus-file.c +++ b/src/nautilus-file.c @@ -2372,8 +2372,20 @@ nautilus_file_is_local (NautilusFile *file) return nautilus_directory_is_local (file->details->directory); } +/** + * nautilus_file_has_local_path: + * + * @file: a #NautilusFile + * + * Checks whether this file has an obtainable local paths. Usually, this means + * the local path can be obtained by calling g_file_get_path(); this includes + * native and FUSE files. As an exception, the local URI for files in recent:// + * can only be obtained from the G_FILE_ATTRIBUTE_STANDARD_TARGET_URI attribute. + * + * Returns: %TRUE if a local path is known to be obtainable for this file. + */ gboolean -nautilus_file_is_local_or_fuse (NautilusFile *file) +nautilus_file_has_local_path (NautilusFile *file) { g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE); diff --git a/src/nautilus-file.h b/src/nautilus-file.h index 2e4820f97..604e7c61d 100644 --- a/src/nautilus-file.h +++ b/src/nautilus-file.h @@ -423,7 +423,7 @@ gboolean nautilus_file_matches_uri (Nautilu /* Is the file local? */ gboolean nautilus_file_is_local (NautilusFile *file); -gboolean nautilus_file_is_local_or_fuse (NautilusFile *file); +gboolean nautilus_file_has_local_path (NautilusFile *file); /* Comparing two file objects for sorting */ NautilusFileSortType nautilus_file_get_default_sort_type (NautilusFile *file, diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 76fce7a99..6a1cc25b9 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -5142,7 +5142,7 @@ get_file_names_as_parameter_array (GList *selection, g_autoptr (GFile) file_location = NULL; NautilusFile *file = NAUTILUS_FILE (node->data); - if (!nautilus_file_is_local_or_fuse (file)) + if (!nautilus_file_has_local_path (file)) { parameters[i] = NULL; g_strfreev (parameters); @@ -5183,7 +5183,7 @@ get_file_paths_or_uris_as_newline_delimited_string (GList *selection, { g_autofree gchar *path = NULL; - if (!nautilus_file_is_local_or_fuse (file)) + if (!nautilus_file_has_local_path (file)) { g_string_free (expanding_string, TRUE); return g_strdup (""); diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c index 26468c597..cb2d4ea57 100644 --- a/src/nautilus-mime-actions.c +++ b/src/nautilus-mime-actions.c @@ -390,7 +390,7 @@ nautilus_mime_get_default_application_for_file (NautilusFile *file) mime_type = nautilus_file_get_mime_type (file); app = g_app_info_get_default_for_type (mime_type, - !nautilus_file_is_local_or_fuse (file)); + !nautilus_file_has_local_path (file)); g_free (mime_type); if (app == NULL) |