[nautilus/wip/antoniof/local_vs_native_fixup: 80/90] files-view: Support FUSE paths as script envar




commit be2b5cc3354283e58fdc793b38dab35750b0efbc
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 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]