[gvfs] afc: Fix error when renaming files in Documents



commit 923cdaffff92695b81d1a2fb8076c3c548c0f480
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jun 9 12:45:28 2016 +0200

    afc: Fix error when renaming files in Documents
    
    When renaming a file in Documents, the callers expect the new path in
    the global scheme, not the path inside the HouseArrest AFC itself.
    
    This fixes a warning in nautilus when renaming files.

 daemon/gvfsbackendafc.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index f1b1758..f28efac 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -2363,9 +2363,15 @@ g_vfs_backend_afc_set_display_name (GVfsBackend *backend,
       return;
     }
 
-  g_vfs_job_set_display_name_set_new_path (job, new_path);
+  g_free (new_path);
   g_free (afc_path);
+
+  /* The new path, but in the original namespace */
+  dirname = g_path_get_dirname (filename);
+  new_path = g_build_filename (dirname, display_name, NULL);
+  g_vfs_job_set_display_name_set_new_path (job, new_path);
   g_free (new_path);
+  g_free (dirname);
 
   g_vfs_job_succeeded (G_VFS_JOB(job));
 }


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