[gvfs] afp: set proper error message for some more FPEnumerateExt2 errors



commit b5eb2904d5adb4c8ce7f554a2e9897049933814d
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Sat Jul 23 02:16:31 2011 +0200

    afp: set proper error message for some more FPEnumerateExt2 errors

 daemon/gvfsafpconnection.h |    1 +
 daemon/gvfsbackendafp.c    |   12 ++++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsafpconnection.h b/daemon/gvfsafpconnection.h
index 429fa0a..586d14b 100644
--- a/daemon/gvfsafpconnection.h
+++ b/daemon/gvfsafpconnection.h
@@ -217,6 +217,7 @@ typedef enum
   AFP_RESULT_OBJECT_TYPE_ERR     = -5025,
   AFP_RESULT_TOO_MANY_FILES_OPEN = -5026,
   AFP_RESULT_CANT_RENAME         = -5028,
+  AFP_RESULT_DIR_NOT_FOUND       = -5029,
   AFP_RESULT_VOL_LOCKED          = -5031,
   AFP_RESULT_OBJECT_LOCKED       = -5032
 } AfpResultCode;
diff --git a/daemon/gvfsbackendafp.c b/daemon/gvfsbackendafp.c
index b5b0360..5d0444f 100644
--- a/daemon/gvfsbackendafp.c
+++ b/daemon/gvfsbackendafp.c
@@ -2219,6 +2219,18 @@ enumerate_ext2_cb (GObject *source_object, GAsyncResult *res, gpointer user_data
     
     switch (res_code)
     {
+      case AFP_RESULT_ACCESS_DENIED:
+        g_vfs_job_failed (G_VFS_JOB (job), G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+                          _("Access denied"));
+        break;
+      case AFP_RESULT_DIR_NOT_FOUND:
+        g_vfs_job_failed (G_VFS_JOB (job), G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
+                          _("Directory doesn't exist"));
+        break;
+      case AFP_RESULT_OBJECT_TYPE_ERR:
+        g_vfs_job_failed (G_VFS_JOB (job), G_IO_ERROR, G_IO_ERROR_NOT_DIRECTORY,
+                          _("Target object is not a directory"));
+        break;
       case AFP_RESULT_OBJECT_NOT_FOUND:
         g_vfs_job_succeeded (G_VFS_JOB (job));
         g_vfs_job_enumerate_done (job);



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