diff options
author | António Fernandes <antoniof@gnome.org> | 2020-05-11 13:15:25 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2021-01-25 10:54:11 +0000 |
commit | be2b5cc3354283e58fdc793b38dab35750b0efbc (patch) | |
tree | 3cd30135ebedcd33a000646088aef9e6427079d1 | |
parent | 206957070eb17776b95e1286e288267d631c3abc (diff) | |
download | nautilus-be2b5cc3354283e58fdc793b38dab35750b0efbc.tar.gz |
files-view: Support FUSE paths as script envar
The scripts in the Scripts menu are passed the local paths of selected
files as a NAUTILUS_SCRIPT_SELECTED_FILE_PATHS environment variable.
But in some cases files may not have a backing local path. We account
for this by checking for the "file:" URI schema. But the accompaining
comment is outdated, because nautilus_directory_is_local() changed
behaviour as a result of the gnome-vfs -> GIO port.
Furthermore, thanks to FUSE, we can have valid local paths for
non-native locations, but we haven't been passing these to scripts.
To fix this, we can use nautilus_directory_is_local_or_fuse() now. Also
drop the eel_uri_is_trash() check, which is now redundact.
-rw-r--r-- | src/nautilus-files-view.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 43c56ef7a..a36209073 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -5236,12 +5236,8 @@ get_strings_for_environment_variables (NautilusFilesView *view, priv = nautilus_files_view_get_instance_private (view); - /* We need to check that the directory uri starts with "file:" since - * nautilus_directory_is_local returns FALSE for nfs. - */ directory_uri = nautilus_directory_get_uri (priv->model); - if (g_str_has_prefix (directory_uri, "file:") || - eel_uri_is_trash (directory_uri) || + if (nautilus_directory_is_local_or_fuse (priv->model) || eel_uri_is_search (directory_uri)) { *file_paths = get_file_paths_as_newline_delimited_string (view, selected_files); |