[gvfs/gnome-3-20] afc: Fix error when renaming files in Documents



commit 21889530292c9cb64a67eca262ebb5d08e5a13b3
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 835e98d..c92e2af 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -2327,9 +2327,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]