[nautilus/wip/antoniof/local_vs_native_fixup: 147/157] files-view: Support FUSE paths as script envar
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/local_vs_native_fixup: 147/157] files-view: Support FUSE paths as script envar
- Date: Mon, 14 Dec 2020 19:00:50 +0000 (UTC)
commit 524d7bb5f8e545d96d9df44c86876cd565ecc811
Author: António Fernandes <antoniof gnome org>
Date: Mon May 11 13:15:25 2020 +0100
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.
src/nautilus-files-view.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index cd46cbf95..b0ef57dbf 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -5233,12 +5233,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]