[gvfs] MTP: Respect remove_source in do_push.



commit 17d65f4c96866477de43928f1c353ebf1e1cca99
Author: Philip Langdale <philipl overt org>
Date:   Tue Feb 12 21:34:56 2013 -0800

    MTP: Respect remove_source in do_push.
    
    I still think it's odd that it's the backend's responsibility to
    delete the source file, as opposed to the client.

 daemon/gvfsbackendmtp.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsbackendmtp.c b/daemon/gvfsbackendmtp.c
index c9f305c..4c1cdc0 100644
--- a/daemon/gvfsbackendmtp.c
+++ b/daemon/gvfsbackendmtp.c
@@ -1328,6 +1328,12 @@ do_push (GVfsBackend *backend,
     goto exit;
   }
 
+  /* Attempt to delete object if requested but don't fail it it fails. */
+  if (remove_source) {
+    DEBUG ("(I) Removing source.");
+    g_file_delete (file, G_VFS_JOB (job)->cancellable, NULL);
+  }
+
   g_vfs_job_succeeded (G_VFS_JOB (job));
 
   g_hash_table_foreach (G_VFS_BACKEND_MTP (backend)->monitors,


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