[gvfs/gdbus-core] gdbus: Handle not yet spawned mountables



commit 41f23398073adf8a62e11a72fbdfbcd3fcb7de48
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Wed Apr 18 15:37:00 2012 +0200

    gdbus: Handle not yet spawned mountables
    
    This makes http backend working again.

 daemon/mount.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)
---
diff --git a/daemon/mount.c b/daemon/mount.c
index 2fb1262..a46f7ef 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
@@ -282,19 +282,16 @@ dbus_mount_reply (GVfsDBusMountable *proxy,
                                               res,
                                               &error))
     {
-      g_warning ("dbus_mount_reply: Error from org.gtk.vfs.Mountable.mount(): %s", error->message);
-      g_warning ("dbus_mount_reply: TODO handle not spawned");
-
-      /* FIXME: handle NOT_SPAWNED */
-#if 0
-      if ((dbus_message_is_error (reply, DBUS_ERROR_NAME_HAS_NO_OWNER) ||
-           dbus_message_is_error (reply, DBUS_ERROR_SERVICE_UNKNOWN)) &&
-          !data->spawned)
+      if ((g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER) ||
+           g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN)) &&
+           !data->spawned)
         spawn_mount (data);
-#endif
-      
-      mount_finish (data, error);
-      g_error_free (error);
+      else
+        {
+          g_warning ("dbus_mount_reply: Error from org.gtk.vfs.Mountable.mount(): %s", error->message);
+          mount_finish (data, error);
+          g_error_free (error);
+        }
     }
   else
     {
@@ -326,14 +323,12 @@ mountable_mount_proxy_cb (GObject *source_object,
   g_dbus_proxy_set_default_timeout (G_DBUS_PROXY (proxy), 
                                     G_VFS_DBUS_MOUNT_TIMEOUT_MSECS);
   
-  g_print ("mountable_mount_with_name: before call_mount\n");
   gvfs_dbus_mountable_call_mount (proxy,
                                   g_mount_spec_to_dbus (data->mount_spec),
                                   data->automount,
                                   g_mount_source_to_dbus (data->source),
                                   NULL,
                                   (GAsyncReadyCallback) dbus_mount_reply, data);
-  g_print ("mountable_mount_with_name: after call_mount\n");
 
   g_object_unref (proxy);
 }



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