[gvfs/mtp-backend: 35/64] MTP: Use fail_job everywhere its needed.



commit f3bf0261425fba0325b29f553d5ef1b088e87f5d
Author: Philip Langdale <philipl overt org>
Date:   Sat Oct 6 19:53:54 2012 -0700

    MTP: Use fail_job everywhere its needed.

 daemon/gvfsbackendmtp.c |   16 +++-------------
 1 files changed, 3 insertions(+), 13 deletions(-)
---
diff --git a/daemon/gvfsbackendmtp.c b/daemon/gvfsbackendmtp.c
index b8fef70..6f4158d 100644
--- a/daemon/gvfsbackendmtp.c
+++ b/daemon/gvfsbackendmtp.c
@@ -818,9 +818,7 @@ do_query_info (GVfsBackend *backend,
       get_file_info(backend, device, info, file);
       LIBMTP_destroy_file_t(file);
     } else {
-      g_vfs_job_failed (G_VFS_JOB (job),
-                        G_IO_ERROR, G_IO_ERROR_FAILED,
-                        "Error while querying entity.");
+      fail_job(G_VFS_JOB(job), device);
       goto exit;
     }
   }
@@ -1054,11 +1052,7 @@ do_push(GVfsBackend *backend,
   g_free(mtp_progress_data);
   LIBMTP_destroy_file_t(mtpfile);
   if (ret != 0) {
-    LIBMTP_Dump_Errorstack(device);
-    LIBMTP_Clear_Errorstack(device);
-    g_vfs_job_failed (G_VFS_JOB (job),
-                      G_IO_ERROR, G_IO_ERROR_FAILED,
-                      "Error while uploading entity.");
+    fail_job(G_VFS_JOB(job), device);
     goto exit;
   }
 
@@ -1109,11 +1103,7 @@ do_make_directory (GVfsBackend *backend,
 
   int ret = LIBMTP_Create_Folder(device, elements[ne-1], parent_id, strtol(elements[1], NULL, 10));
   if (ret == 0) {
-    LIBMTP_Dump_Errorstack(device);
-    LIBMTP_Clear_Errorstack(device);
-    g_vfs_job_failed (G_VFS_JOB (job),
-                      G_IO_ERROR, G_IO_ERROR_FAILED,
-                      "Error while creating directory.");
+    fail_job(G_VFS_JOB(job), device);
     goto exit;
   }
 



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