[PATCH] Fix coding style



---
 daemon/gvfsbackendafc.c          | 1738 +++++++++++++++++++++-----------------
 daemon/gvfsbackendafc.h          |   22 +-
 monitor/afc/afc-volume-monitor.c |  353 ++++----
 monitor/afc/afc-volume-monitor.h |   26 +-
 monitor/afc/afc-volume.c         |  286 ++++---
 monitor/afc/afc-volume.h         |   31 +-
 6 files changed, 1323 insertions(+), 1133 deletions(-)

diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index f996460..b7e701a 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -40,52 +40,54 @@
 int g_blocksize = 4096; /* assume this is the default block size */
 
 struct _GVfsBackendAfc {
-    GVfsBackend backend;
+  GVfsBackend backend;
 
-    DBusConnection *dbus_connection;
-    LibHalContext *hal_ctx;
-    char *hal_udi;
+  DBusConnection *dbus_connection;
+  LibHalContext *hal_ctx;
+  char *hal_udi;
 
-    char uuid[41];
-    char *service;
-    char *model;
-    gboolean connected;
+  char uuid[41];
+  char *service;
+  char *model;
+  gboolean connected;
 
-    iphone_device_t dev;
-    afc_client_t afc_cli;
+  iphone_device_t dev;
+  afc_client_t afc_cli;
 };
 
 struct afc_error_mapping {
-    afc_error_t from;
-    GIOErrorEnum to;
-} static afc_error_to_g_io_error[] = {
-    {AFC_E_UNKNOWN_ERROR            , G_IO_ERROR_FAILED},
-    {AFC_E_OP_HEADER_INVALID        , G_IO_ERROR_FAILED},
-    {AFC_E_NO_RESOURCES             , G_IO_ERROR_TOO_MANY_OPEN_FILES},
-    {AFC_E_READ_ERROR               , G_IO_ERROR_NOT_DIRECTORY},
-    {AFC_E_WRITE_ERROR              , G_IO_ERROR_FAILED},
-    {AFC_E_UNKNOWN_PACKET_TYPE      , G_IO_ERROR_FAILED},
-    {AFC_E_INVALID_ARGUMENT         , G_IO_ERROR_INVALID_ARGUMENT},
-    {AFC_E_OBJECT_NOT_FOUND         , G_IO_ERROR_NOT_FOUND},
-    {AFC_E_OBJECT_IS_DIR            , G_IO_ERROR_IS_DIRECTORY},
-    {AFC_E_DIR_NOT_EMPTY            , G_IO_ERROR_NOT_EMPTY},
-    {AFC_E_PERM_DENIED              , G_IO_ERROR_PERMISSION_DENIED},
-    {AFC_E_SERVICE_NOT_CONNECTED    , G_IO_ERROR_HOST_NOT_FOUND},
-    {AFC_E_OP_TIMEOUT               , G_IO_ERROR_TIMED_OUT},
-    {AFC_E_TOO_MUCH_DATA            , G_IO_ERROR_FAILED},
-    {AFC_E_END_OF_DATA              , G_IO_ERROR_FAILED},
-    {AFC_E_OP_NOT_SUPPORTED         , G_IO_ERROR_NOT_SUPPORTED},
-    {AFC_E_OBJECT_EXISTS            , G_IO_ERROR_EXISTS},
-    {AFC_E_OBJECT_BUSY              , G_IO_ERROR_BUSY},
-    {AFC_E_NO_SPACE_LEFT            , G_IO_ERROR_NO_SPACE},
-    {AFC_E_OP_WOULD_BLOCK           , G_IO_ERROR_WOULD_BLOCK},
-    {AFC_E_IO_ERROR                 , G_IO_ERROR_FAILED},
-    {AFC_E_OP_INTERRUPTED           , G_IO_ERROR_CANCELLED},
-    {AFC_E_OP_IN_PROGRESS           , G_IO_ERROR_PENDING},
-    {AFC_E_INTERNAL_ERROR           , G_IO_ERROR_FAILED},
-    {AFC_E_NOT_ENOUGH_DATA          , G_IO_ERROR_CLOSED},
-    {AFC_E_MUX_ERROR                , G_IO_ERROR_FAILED},
-    {-1}
+  afc_error_t from;
+  GIOErrorEnum to;
+};
+
+static struct afc_error_mapping afc_error_to_g_io_error[] = {
+      { AFC_E_UNKNOWN_ERROR            , G_IO_ERROR_FAILED },
+      { AFC_E_OP_HEADER_INVALID        , G_IO_ERROR_FAILED },
+      { AFC_E_NO_RESOURCES             , G_IO_ERROR_TOO_MANY_OPEN_FILES },
+      { AFC_E_READ_ERROR               , G_IO_ERROR_NOT_DIRECTORY },
+      { AFC_E_WRITE_ERROR              , G_IO_ERROR_FAILED },
+      { AFC_E_UNKNOWN_PACKET_TYPE      , G_IO_ERROR_FAILED },
+      { AFC_E_INVALID_ARGUMENT         , G_IO_ERROR_INVALID_ARGUMENT },
+      { AFC_E_OBJECT_NOT_FOUND         , G_IO_ERROR_NOT_FOUND },
+      { AFC_E_OBJECT_IS_DIR            , G_IO_ERROR_IS_DIRECTORY },
+      { AFC_E_DIR_NOT_EMPTY            , G_IO_ERROR_NOT_EMPTY },
+      { AFC_E_PERM_DENIED              , G_IO_ERROR_PERMISSION_DENIED },
+      { AFC_E_SERVICE_NOT_CONNECTED    , G_IO_ERROR_HOST_NOT_FOUND },
+      { AFC_E_OP_TIMEOUT               , G_IO_ERROR_TIMED_OUT },
+      { AFC_E_TOO_MUCH_DATA            , G_IO_ERROR_FAILED },
+      { AFC_E_END_OF_DATA              , G_IO_ERROR_FAILED },
+      { AFC_E_OP_NOT_SUPPORTED         , G_IO_ERROR_NOT_SUPPORTED },
+      { AFC_E_OBJECT_EXISTS            , G_IO_ERROR_EXISTS },
+      { AFC_E_OBJECT_BUSY              , G_IO_ERROR_BUSY },
+      { AFC_E_NO_SPACE_LEFT            , G_IO_ERROR_NO_SPACE },
+      { AFC_E_OP_WOULD_BLOCK           , G_IO_ERROR_WOULD_BLOCK },
+      { AFC_E_IO_ERROR                 , G_IO_ERROR_FAILED },
+      { AFC_E_OP_INTERRUPTED           , G_IO_ERROR_CANCELLED },
+      { AFC_E_OP_IN_PROGRESS           , G_IO_ERROR_PENDING },
+      { AFC_E_INTERNAL_ERROR           , G_IO_ERROR_FAILED },
+      { AFC_E_NOT_ENOUGH_DATA          , G_IO_ERROR_CLOSED },
+      { AFC_E_MUX_ERROR                , G_IO_ERROR_FAILED },
+      { -1 }
 };
 
 /** 
@@ -95,114 +97,133 @@ struct afc_error_mapping {
  *
  * @return errno value.
  */
-static GIOErrorEnum g_io_error_from_afc_error(afc_error_t error)
+static GIOErrorEnum
+g_io_error_from_afc_error (afc_error_t error)
 {
-    GIOErrorEnum res = G_IO_ERROR_FAILED;
-    int i = 0; gboolean found = FALSE;
-
-    while (afc_error_to_g_io_error[i++].from != -1) {
-        if (afc_error_to_g_io_error[i].from == error) {
-            res = afc_error_to_g_io_error[i++].to;
-            found = TRUE;
-            break;
+  GIOErrorEnum res = G_IO_ERROR_FAILED;
+  int i = 0; gboolean found = FALSE;
+
+  while (afc_error_to_g_io_error[i++].from != -1)
+    {
+      if (afc_error_to_g_io_error[i].from == error)
+        {
+          res = afc_error_to_g_io_error[i++].to;
+          found = TRUE;
+          break;
         }
     }
 
-    if (!found) {
-        g_warning("Unknown AFC error (%d).\n", error);
-    }
+  if (!found)
+    g_warning ("Unknown AFC error (%d).\n", error);
 
-    return res;
+  return res;
 }
 
 G_DEFINE_TYPE(GVfsBackendAfc, g_vfs_backend_afc, G_VFS_TYPE_BACKEND)
 
-static void g_vfs_backend_afc_close_connection(GVfsBackendAfc *self);
+static void
+g_vfs_backend_afc_close_connection (GVfsBackendAfc *self)
+{
+  if (self->connected)
+    {
+      afc_client_free (self->afc_cli);
+      g_free (self->model);
+      self->model = NULL;
+      g_free (self->hal_udi);
+      self->hal_udi = NULL;
+      iphone_device_free (self->dev);
+    }
+  self->connected = FALSE;
+}
 
-static int g_vfs_backend_afc_check(afc_error_t cond, GVfsJob *job)
+static int
+g_vfs_backend_afc_check (afc_error_t cond, GVfsJob *job)
 {
-    GIOErrorEnum error;
-    if (G_LIKELY(cond == AFC_E_SUCCESS))
+  GIOErrorEnum error;
+
+  if (G_LIKELY(cond == AFC_E_SUCCESS))
         return 0;
-    else {
-        error = g_io_error_from_afc_error(cond);
-        switch (cond) {
-        case AFC_E_INTERNAL_ERROR:
-            g_vfs_job_failed(job, G_IO_ERROR, error,
-                    _("Internal Apple File Control error"));
-            break;
-        case AFC_E_OBJECT_NOT_FOUND:
-            g_vfs_job_failed(job, G_IO_ERROR, error,
-                    _("File does not exist"));
-        case AFC_E_DIR_NOT_EMPTY:
-            g_vfs_job_failed(job, G_IO_ERROR, error,
-                    _("The directory is not empty"));
-            break;
-        case AFC_E_OP_TIMEOUT:
-            g_vfs_job_failed(job, G_IO_ERROR, error,
-                    _("The device did not respond"));
-            break;
-        case AFC_E_NOT_ENOUGH_DATA:
-            g_vfs_job_failed(job, G_IO_ERROR, error,
-                    _("The connection was interrupted"));
-            break;
-        case AFC_E_MUX_ERROR:
-            g_vfs_job_failed(job, G_IO_ERROR, error,
-                    _("Invalid Apple File Control data received"));
-            break;
-        default:
-            g_vfs_job_failed(job, G_IO_ERROR, error,
-                    _("Unhandled Apple File Control error (%d)"), cond);
-            break;
-        }
+
+  error = g_io_error_from_afc_error (cond);
+  switch (cond)
+    {
+    case AFC_E_INTERNAL_ERROR:
+      g_vfs_job_failed (job, G_IO_ERROR, error,
+                        _("Internal Apple File Control error"));
+      break;
+    case AFC_E_OBJECT_NOT_FOUND:
+      g_vfs_job_failed (job, G_IO_ERROR, error,
+                        _("File does not exist"));
+    case AFC_E_DIR_NOT_EMPTY:
+      g_vfs_job_failed (job, G_IO_ERROR, error,
+                        _("The directory is not empty"));
+      break;
+    case AFC_E_OP_TIMEOUT:
+      g_vfs_job_failed (job, G_IO_ERROR, error,
+                        _("The device did not respond"));
+      break;
+    case AFC_E_NOT_ENOUGH_DATA:
+      g_vfs_job_failed (job, G_IO_ERROR, error,
+                        _("The connection was interrupted"));
+      break;
+    case AFC_E_MUX_ERROR:
+      g_vfs_job_failed (job, G_IO_ERROR, error,
+                        _("Invalid Apple File Control data received"));
+      break;
+    default:
+      g_vfs_job_failed (job, G_IO_ERROR, error,
+                        _("Unhandled Apple File Control error (%d)"), cond);
+      break;
     }
 
-    return 1;
+  return 1;
 }
 
-static int g_vfs_backend_lockdownd_check(lockdownd_error_t cond, GVfsJob *job)
+static int
+g_vfs_backend_lockdownd_check (lockdownd_error_t cond, GVfsJob *job)
 {
-    GIOErrorEnum error;
-    if (G_LIKELY(cond == LOCKDOWN_E_SUCCESS))
+  GIOErrorEnum error;
+  if (G_LIKELY(cond == LOCKDOWN_E_SUCCESS))
         return 0;
-    else {
-        switch (cond) {
-        case LOCKDOWN_E_INVALID_ARG:
-            g_vfs_job_failed(job, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
-                    _("Lockdown Error: Invalid Argument"));
-            break;
-        default:
-            g_vfs_job_failed(job, G_IO_ERROR, G_IO_ERROR_FAILED,
-                    _("Unhandled Lockdown error (%d)"), cond);
-            break;
-        }
+
+  switch (cond)
+    {
+    case LOCKDOWN_E_INVALID_ARG:
+      g_vfs_job_failedo (job, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+                         _("Lockdown Error: Invalid Argument"));
+      break;
+    default:
+      g_vfs_job_failed (job, G_IO_ERROR, G_IO_ERROR_FAILED,
+                        _("Unhandled Lockdown error (%d)"), cond);
+      break;
     }
 
-    return 1;
+  return 1;
 }
 
-static int g_vfs_backend_iphone_check(iphone_error_t cond, GVfsJob *job)
+static int
+g_vfs_backend_iphone_check (iphone_error_t cond, GVfsJob *job)
 {
-    GIOErrorEnum error;
-    if (G_LIKELY(cond == IPHONE_E_SUCCESS))
+  GIOErrorEnum error;
+  if (G_LIKELY(cond == IPHONE_E_SUCCESS))
         return 0;
-    else {
-        switch (cond) {
-        case IPHONE_E_INVALID_ARG:
-            g_vfs_job_failed(job, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
-                    _("iPhone Device Error: Invalid Argument"));
-            break;
-        case IPHONE_E_NO_DEVICE:
-            g_vfs_job_failed(job, G_IO_ERROR, G_IO_ERROR_FAILED,
-                    _("iPhone Device Error: No device found. Make sure usbmuxd is set up correctly."));
-        default:
-            g_vfs_job_failed(job, G_IO_ERROR, G_IO_ERROR_FAILED,
-                    _("Unhandled iPhone Device error (%d)"), cond);
-            break;
-        }
+
+  switch (cond)
+    {
+    case IPHONE_E_INVALID_ARG:
+      g_vfs_job_failed (job, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+                        _("iPhone Device Error: Invalid Argument"));
+      break;
+    case IPHONE_E_NO_DEVICE:
+      g_vfs_job_failed (job, G_IO_ERROR, G_IO_ERROR_FAILED,
+                        _("iPhone Device Error: No device found. Make sure usbmuxd is set up correctly."));
+    default:
+      g_vfs_job_failed (job, G_IO_ERROR, G_IO_ERROR_FAILED,
+                        _("Unhandled iPhone Device error (%d)"), cond);
+      break;
     }
 
-    return 1;
+  return 1;
 }
 
 static void
@@ -211,8 +232,9 @@ _hal_device_removed (LibHalContext *hal_ctx, const char *udi)
   GVfsBackendAfc *afc_backend;
 
   afc_backend = G_VFS_BACKEND_AFC (libhal_ctx_get_user_data (hal_ctx));
+  g_return_val_if_fail (afc_backend->hal_udi != NULL);
 
-  if (afc_backend->hal_udi != NULL && strcmp (udi, afc_backend->hal_udi) == 0)
+  if (g_str_equal (udi, afc_backend->hal_udi))
     {
       g_print ("Shutting down AFC backend for device uuid %s\n", afc_backend->uuid);
 
@@ -224,672 +246,799 @@ _hal_device_removed (LibHalContext *hal_ctx, const char *udi)
 }
 
 /* Callback for mounting. */
-static void g_vfs_backend_afc_mount(GVfsBackend *backend, GVfsJobMount *job,
-        GMountSpec *spec, GMountSource *src, gboolean automounting)
+static void
+g_vfs_backend_afc_mount (GVfsBackend *backend,
+                         GVfsJobMount *job,
+                         GMountSpec *spec,
+                         GMountSource *src,
+                         gboolean automounting)
 {
-    const char *str;
-    char *display_name;
-    int port, virtual_port;
-    GMountSpec *real_spec;
-    GVfsBackendAfc *self;
-    GError *error = NULL;
-    DBusError dbus_error;
-    int retries;
-    iphone_error_t err;
-    int n;
-    int num_afc_devices;
-    char **afc_devices;
-    lockdownd_client_t lockdown_cli = NULL;
-
-    self = G_VFS_BACKEND_AFC(backend);
-    self->connected = FALSE;
-
-    /* setup libhal */
-
-    dbus_error_init (&dbus_error);
-    self->dbus_connection = dbus_bus_get_private (DBUS_BUS_SYSTEM, &dbus_error);
-    if (dbus_error_is_set (&dbus_error))
+  const char *str;
+  char *display_name;
+  int port, virtual_port;
+  GMountSpec *real_spec;
+  GVfsBackendAfc *self;
+  GError *error = NULL;
+  DBusError dbus_error;
+  int retries;
+  iphone_error_t err;
+  int n;
+  int num_afc_devices;
+  char **afc_devices;
+  lockdownd_client_t lockdown_cli = NULL;
+
+  self = G_VFS_BACKEND_AFC(backend);
+  self->connected = FALSE;
+
+  /* setup libhal */
+
+  dbus_error_init (&dbus_error);
+  self->dbus_connection = dbus_bus_get_private (DBUS_BUS_SYSTEM, &dbus_error);
+  if (dbus_error_is_set (&dbus_error))
     {
-        g_vfs_backend_afc_close_connection (self);
-        dbus_error_free (&dbus_error);
-        g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot connect to the system bus"));
-        g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
-        g_error_free (error);
-        return;
+      g_vfs_backend_afc_close_connection (self);
+      dbus_error_free (&dbus_error);
+      g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot connect to the system bus"));
+      g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+      g_error_free (error);
+      return;
     }
 
-    dbus_connection_set_exit_on_disconnect (self->dbus_connection, FALSE);
+  dbus_connection_set_exit_on_disconnect (self->dbus_connection, FALSE);
 
-    self->hal_ctx = libhal_ctx_new ();
-    if (self->hal_ctx == NULL)
+  self->hal_ctx = libhal_ctx_new ();
+  if (self->hal_ctx == NULL)
     {
-        g_vfs_backend_afc_close_connection (self);
-        g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot create libhal context"));
-        g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
-        g_error_free (error);
-        return;
+      g_vfs_backend_afc_close_connection (self);
+      g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot create libhal context"));
+      g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+      g_error_free (error);
+      return;
     }
 
-    _g_dbus_connection_integrate_with_main (self->dbus_connection);
-    libhal_ctx_set_dbus_connection (self->hal_ctx, self->dbus_connection);
-  
-    if (!libhal_ctx_init (self->hal_ctx, &dbus_error))
+  _g_dbus_connection_integrate_with_main (self->dbus_connection);
+  libhal_ctx_set_dbus_connection (self->hal_ctx, self->dbus_connection);
+
+  if (!libhal_ctx_init (self->hal_ctx, &dbus_error))
     {
-        g_vfs_backend_afc_close_connection (self);
-        dbus_error_free (&dbus_error);
-        g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot initialize libhal"));
-        g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
-        g_error_free (error);
-        return;
+      g_vfs_backend_afc_close_connection (self);
+      dbus_error_free (&dbus_error);
+      g_set_error_literal (&error, G_IO_ERROR, G_IO_ERROR_FAILED, _("Cannot initialize libhal"));
+      g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+      g_error_free (error);
+      return;
     }
 
   /* setup afc */
 
-    str = g_mount_spec_get(spec, "host");
-    if (G_UNLIKELY(str == NULL)) {
-        g_vfs_job_failed (G_VFS_JOB (job),
-                          G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
-                          _("Invalid mount spec"));
-        return;
+  str = g_mount_spec_get(spec, "host");
+  if (G_UNLIKELY(str == NULL))
+    {
+      g_vfs_job_failed (G_VFS_JOB (job),
+                        G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+                        _("Invalid mount spec"));
+      return;
     }
-    if (G_UNLIKELY(sscanf(str, "%40s", &self->uuid)
-                < 1)) {
-        g_vfs_job_failed(G_VFS_JOB(job), G_IO_ERROR, G_IO_ERROR_FAILED,
-                _("Invalid AFC location: must be in the form of "
-                    "afc://uuid:port-number"));
-        return;
+  if (G_UNLIKELY(sscanf(str, "%40s", &self->uuid) < 1))
+    {
+      g_vfs_job_failed (G_VFS_JOB(job), G_IO_ERROR, G_IO_ERROR_FAILED,
+                        _("Invalid AFC location: must be in the form of "
+                          "afc://uuid:port-number"));
+      return;
     }
 
-    afc_devices = libhal_find_device_by_capability (self->hal_ctx, "afc",
-                                                     &num_afc_devices, NULL);
+  afc_devices = libhal_find_device_by_capability (self->hal_ctx, "afc",
+                                                  &num_afc_devices, NULL);
 
-    for (n = 0; (self->hal_udi == NULL) && n < num_afc_devices; n++) {
-        char *udi = afc_devices[n];
-        LibHalPropertySet *ps;
-
-        ps = libhal_device_get_all_properties (self->hal_ctx, udi, NULL);
-        if (ps != NULL) {
-            const char *usb_serial = libhal_ps_get_string(ps, "usb.serial");
-	    printf("%s\n", usb_serial);
-            if (!strcmp(usb_serial, self->uuid)) {
-                self->hal_udi = g_strdup(udi);
+  for (n = 0; (self->hal_udi == NULL) && n < num_afc_devices; n++)
+    {
+      char *udi = afc_devices[n];
+      LibHalPropertySet *ps;
+
+      ps = libhal_device_get_all_properties (self->hal_ctx, udi, NULL);
+      if (ps != NULL)
+        {
+          const char *usb_serial = libhal_ps_get_string(ps, "usb.serial");
+          printf("%s\n", usb_serial);
+          if (!strcmp(usb_serial, self->uuid))
+            {
+              self->hal_udi = g_strdup(udi);
             }
-            libhal_free_property_set (ps);
+          libhal_free_property_set (ps);
         }
     }
-    libhal_free_string_array (afc_devices);
-
-    libhal_ctx_set_device_removed (self->hal_ctx, _hal_device_removed);
-    libhal_ctx_set_user_data (self->hal_ctx, self);
-
-    str = g_mount_spec_get(spec, "port");
-    if (str == NULL)
-        virtual_port = 1;
-    else 
-        sscanf(str, "%d", &virtual_port);
-
-    /* set a generic display name */
-    if (virtual_port >= 2) {
-        self->service = g_strdup_printf("com.apple.afc%d", virtual_port);
-        display_name = g_strdup_printf(_("Service %d on Apple Mobile Device"),
-                virtual_port);
-    } else {
-        self->service = g_strdup("com.apple.afc");
-        display_name = g_strdup_printf(_("Apple Mobile Device"));
+  libhal_free_string_array (afc_devices);
+
+  libhal_ctx_set_device_removed (self->hal_ctx, _hal_device_removed);
+  libhal_ctx_set_user_data (self->hal_ctx, self);
+
+  str = g_mount_spec_get (spec, "port");
+  if (str == NULL)
+    virtual_port = 1;
+  else
+    virtual_port = atoi (str);
+
+  /* set a generic display name */
+  if (virtual_port >= 2)
+    {
+      self->service = g_strdup_printf ("com.apple.afc%d", virtual_port);
+      display_name = g_strdup_printf (_("Service %d on Apple Mobile Device"),
+                                      virtual_port);
+    }
+  else
+    {
+      self->service = g_strdup ("com.apple.afc");
+      display_name = g_strdup_printf (_("Apple Mobile Device"));
     }
 
-    g_vfs_backend_set_display_name(G_VFS_BACKEND(self), display_name);
-    g_free(display_name);
-
-    real_spec = g_mount_spec_new("afc");
-    g_mount_spec_set(real_spec, "host", g_strdup_printf("%40s",
-                &self->uuid));
-
-    /* INFO: Don't ever set the DefaultPort again or everything goes crazy */
-    if (virtual_port != 1)
-        g_mount_spec_set(real_spec, "port", g_strdup_printf("%d", virtual_port));
-    g_vfs_backend_set_mount_spec(G_VFS_BACKEND(self), real_spec);
-    g_mount_spec_unref(real_spec);
-
-    retries = 0;
-    do {
-	err = iphone_get_device_by_uuid(&self->dev, self->uuid);
-	if (err == IPHONE_E_SUCCESS) {
-	    break;
-	}
-	sleep (1);
-    } while (retries++ < 10);
-
-    if (G_UNLIKELY(g_vfs_backend_iphone_check(err, G_VFS_JOB(job))))
-        goto out_destroy_service;
-    if (G_UNLIKELY(g_vfs_backend_lockdownd_check(lockdownd_client_new(self->dev,
-                        &lockdown_cli), G_VFS_JOB(job))))
-        goto out_destroy_dev;
-
-    /* try to use pretty device name */
-    if (LOCKDOWN_E_SUCCESS == lockdownd_get_device_name(lockdown_cli,
-                        &display_name)) {
-        if (display_name) {
-            if (virtual_port >= 2)
+  g_vfs_backend_set_display_name (G_VFS_BACKEND(self), display_name);
+  g_free (display_name);
+
+  real_spec = g_mount_spec_new ("afc");
+  //FIXME leaking self->uuid, can't we be sure it's in the right format already?
+  g_mount_spec_set (real_spec, "host", g_strdup_printf ("%40s", &self->uuid));
+
+  /* INFO: Don't ever set the DefaultPort again or everything goes crazy
+   * FIXME leaking port here */
+  if (virtual_port != 1)
+    g_mount_spec_set(real_spec, "port", g_strdup_printf("%d", virtual_port));
+
+  g_vfs_backend_set_mount_spec (G_VFS_BACKEND(self), real_spec);
+  g_mount_spec_unref (real_spec);
+
+  retries = 0;
+  do {
+      err = iphone_get_device_by_uuid(&self->dev, self->uuid);
+      if (err == IPHONE_E_SUCCESS)
+          break;
+      g_usleep (G_USEC_PER_SEC);
+  } while (retries++ < 10);
+
+  if (G_UNLIKELY(g_vfs_backend_iphone_check(err, G_VFS_JOB(job))))
+    goto out_destroy_service;
+  if (G_UNLIKELY(g_vfs_backend_lockdownd_check (lockdownd_client_new (self->dev,
+                                                                      &lockdown_cli),
+                                                G_VFS_JOB(job))))
+    {
+      goto out_destroy_dev;
+    }
+
+  /* try to use pretty device name */
+  if (LOCKDOWN_E_SUCCESS == lockdownd_get_device_name (lockdown_cli, &display_name))
+    {
+      if (display_name)
+        {
+          if (virtual_port >= 2)
             {
-                g_vfs_backend_set_display_name(G_VFS_BACKEND(self), 
-                g_strdup_printf(_("%s (%s)"), display_name, self->service));
+              g_vfs_backend_set_display_name (G_VFS_BACKEND(self), 
+                                              g_strdup_printf(_("%s (%s)"), display_name, self->service));
             }
-            else
-                g_vfs_backend_set_display_name(G_VFS_BACKEND(self), display_name);
-            g_free(display_name);
-        }
+          else
+            {
+              g_vfs_backend_set_display_name (G_VFS_BACKEND(self), display_name);
+            }
+          g_free (display_name);
+      }
     }
 
-    if (G_UNLIKELY(g_vfs_backend_lockdownd_check(lockdownd_start_service(
-                        lockdown_cli, self->service, &port),
-                    G_VFS_JOB(job))))
-        goto out_destroy_lockdown;
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_client_new(self->dev,
-                        port, &self->afc_cli), G_VFS_JOB(job))))
-        goto out_destroy_lockdown;
+  if (G_UNLIKELY(g_vfs_backend_lockdownd_check (lockdownd_start_service (lockdown_cli,
+                                                                         self->service, &port),
+                                                G_VFS_JOB(job))))
+    {
+      goto out_destroy_lockdown;
+    }
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_client_new (self->dev,
+                                                          port, &self->afc_cli),
+                                          G_VFS_JOB(job))))
+    {
+      goto out_destroy_lockdown;
+    }
 
-    /* set correct fd icon spec name depending on device model */
-    self->model = afc_get_device_info_field (self->afc_cli, "Model");
-    if (G_UNLIKELY(self->model == NULL))
-        goto out_destroy_afc;
+  /* set correct fd icon spec name depending on device model */
+  self->model = afc_get_device_info_field (self->afc_cli, "Model");
+  if (G_UNLIKELY(self->model == NULL))
+    goto out_destroy_afc;
 
-    if((self->model != NULL) && (strstr(self->model, "iPod") != NULL))
-        g_vfs_backend_set_icon_name(G_VFS_BACKEND(self), "multimedia-player-apple-ipod-touch");
-    else
-        g_vfs_backend_set_icon_name(G_VFS_BACKEND(self), "phone-apple-iphone");
+  if (strstr(self->model, "iPod") != NULL)
+    {
+      g_vfs_backend_set_icon_name (G_VFS_BACKEND(self), "multimedia-player-apple-ipod-touch");
+    }
+  else
+    {
+      g_vfs_backend_set_icon_name (G_VFS_BACKEND(self), "phone-apple-iphone");
+    }
 
-    /* lockdown connection is not needed anymore */
-    lockdownd_client_free(lockdown_cli);
+  /* lockdown connection is not needed anymore */
+  lockdownd_client_free (lockdown_cli);
 
-    self->connected = TRUE;
-    g_vfs_job_succeeded(G_VFS_JOB(job));
-    return;
+  self->connected = TRUE;
+  g_vfs_job_succeeded (G_VFS_JOB(job));
+  return;
 
 out_destroy_afc:
-    afc_client_free(self->afc_cli);
+  afc_client_free (self->afc_cli);
+
 out_destroy_lockdown:
-    lockdownd_client_free(lockdown_cli);
+  lockdownd_client_free (lockdown_cli);
+
 out_destroy_dev:
-    iphone_device_free(self->dev);
-out_destroy_service:
-    g_free(self->service);
-    if(self->model)
-        g_free(self->model);
-}
+  iphone_device_free (self->dev);
 
-static void g_vfs_backend_afc_close_connection(GVfsBackendAfc *self)
-{
-    if (self->connected) {
-        afc_client_free(self->afc_cli);
-        if(self->model)
-            g_free(self->model);
-        if(self->hal_udi)
-            g_free (self->hal_udi);
-        self->hal_udi = NULL;
-        iphone_device_free(self->dev);
-    }
-    self->connected = FALSE;
+out_destroy_service:
+  g_free (self->service);
+  g_free(self->model);
 }
 
-static void g_vfs_backend_afc_unmount(GVfsBackend *backend, GVfsJobUnmount *
-        job)
+static void
+g_vfs_backend_afc_unmount (GVfsBackend *backend,
+                           GVfsJobUnmount * job)
 {
-    GVfsBackendAfc *self;
+  GVfsBackendAfc *self;
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_vfs_backend_afc_close_connection(self);
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  self = G_VFS_BACKEND_AFC (backend);
+  g_vfs_backend_afc_close_connection (self);
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
 /* Callback to open an existing file for reading. */
-static void g_vfs_backend_afc_open_for_read(GVfsBackend *backend,
-        GVfsJobOpenForRead *job, const char *path)
+static void
+g_vfs_backend_afc_open_for_read (GVfsBackend *backend,
+                                 GVfsJobOpenForRead *job,
+                                 const char *path)
 {
-    uint64_t fd = 0;
-    GVfsBackendAfc *self;
+  uint64_t fd = 0;
+  GVfsBackendAfc *self;
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
 
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_file_open(self->afc_cli,
-                        path, AFC_FOPEN_RDONLY, &fd), G_VFS_JOB(job))))
-        return;
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_file_open (self->afc_cli,
+                                                         path, AFC_FOPEN_RDONLY, &fd),
+                                          G_VFS_JOB(job))))
+    {
+      return;
+    }
 
-    g_vfs_job_open_for_read_set_handle(job, GUINT_TO_POINTER((gulong)fd));
-    g_vfs_job_open_for_read_set_can_seek(job, TRUE);
-    g_vfs_job_succeeded(G_VFS_JOB(job));
-    return;
+  g_vfs_job_open_for_read_set_handle (job, GUINT_TO_POINTER((gulong) fd));
+  g_vfs_job_open_for_read_set_can_seek (job, TRUE);
+  g_vfs_job_succeeded (G_VFS_JOB(job));
+
+  return;
 }
 
 /* Callback to open a nonexistent file for writing. */
-static void g_vfs_backend_afc_create(GVfsBackend *backend,
-        GVfsJobOpenForWrite *job, const char *path, GFileCreateFlags flags)
+static void
+g_vfs_backend_afc_create (GVfsBackend *backend,
+                          GVfsJobOpenForWrite *job,
+                          const char *path,
+                          GFileCreateFlags flags)
 {
-    uint64_t fd = 0;
-    GVfsBackendAfc *self;
+  uint64_t fd = 0;
+  GVfsBackendAfc *self;
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
 
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_file_open(self->afc_cli,
-                        path, AFC_FOPEN_RW, &fd),
-                    G_VFS_JOB(job))))
-        return;
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_file_open (self->afc_cli,
+                                                         path, AFC_FOPEN_RW, &fd),
+                                          G_VFS_JOB(job))))
+    {
+      return;
+    }
 
-    g_vfs_job_open_for_write_set_handle(job, GUINT_TO_POINTER((gulong)fd));
-    g_vfs_job_open_for_write_set_can_seek(job, TRUE);
-    g_vfs_job_succeeded(G_VFS_JOB(job));
-    return;
+  g_vfs_job_open_for_write_set_handle (job, GUINT_TO_POINTER((gulong)fd));
+  g_vfs_job_open_for_write_set_can_seek (job, TRUE);
+  g_vfs_job_succeeded (G_VFS_JOB(job));
+
+  return;
 }
 
 /* Callback to open a possibly-existing file for writing. */
-static void g_vfs_backend_afc_append_to(GVfsBackend *backend,
-        GVfsJobOpenForWrite *job, const char *path, GFileCreateFlags flags)
+static void
+g_vfs_backend_afc_append_to (GVfsBackend *backend,
+                             GVfsJobOpenForWrite *job,
+                             const char *path,
+                             GFileCreateFlags flags)
 {
-    uint64_t fd = 0;
-    uint64_t off = 0;
-    GVfsBackendAfc *self;
-
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
-
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_file_open(
-                            self->afc_cli, path, AFC_FOPEN_RW,
-                            &fd), G_VFS_JOB(job))))
-            return;
-
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_file_seek(
-                            self->afc_cli, fd, 0, SEEK_END), G_VFS_JOB(job))))
-            return;
-
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_file_tell(
-                            self->afc_cli, fd, &off), G_VFS_JOB(job))))
-            return;
-
-    g_vfs_job_open_for_write_set_handle(job, GUINT_TO_POINTER((gulong)fd));
-    g_vfs_job_open_for_write_set_can_seek(job, TRUE);
-    g_vfs_job_open_for_write_set_initial_offset(job, off);
-    g_vfs_job_succeeded(G_VFS_JOB(job));
-    return;
+  uint64_t fd = 0;
+  uint64_t off = 0;
+  GVfsBackendAfc *self;
+
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
+
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_file_open (self->afc_cli,
+                                                         path, AFC_FOPEN_RW, &fd),
+                                          G_VFS_JOB(job))))
+    {
+      return;
+    }
+
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_file_seek (self->afc_cli,
+                                                         fd, 0, SEEK_END),
+                                          G_VFS_JOB(job))))
+    {
+      return;
+    }
+
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_file_tell (self->afc_cli,
+                                                         fd, &off),
+                                          G_VFS_JOB(job))))
+    {
+      return;
+    }
+
+  g_vfs_job_open_for_write_set_handle (job, GUINT_TO_POINTER((gulong)fd));
+  g_vfs_job_open_for_write_set_can_seek (job, TRUE);
+  g_vfs_job_open_for_write_set_initial_offset (job, off);
+  g_vfs_job_succeeded (G_VFS_JOB(job));
+
+  return;
 }
 
-static void g_vfs_backend_afc_replace (GVfsBackend *backend,
-        GVfsJobOpenForWrite *job, const char *filename, const char *etag,
-        gboolean make_backup, GFileCreateFlags flags)
+static void
+g_vfs_backend_afc_replace (GVfsBackend *backend,
+                           GVfsJobOpenForWrite *job,
+                           const char *filename,
+                           const char *etag,
+                           gboolean make_backup,
+                           GFileCreateFlags flags)
 {
-    uint64_t fd = 0;
-    GVfsBackendAfc *self;
+  uint64_t fd = 0;
+  GVfsBackendAfc *self;
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail(self->connected);
 
-    if (make_backup)
+  if (make_backup)
     {
-        /* FIXME: implement! */
-        g_vfs_job_failed (G_VFS_JOB (job),
-			G_IO_ERROR,
-			G_IO_ERROR_CANT_CREATE_BACKUP,
-			_("Backups are not yet supported."));
-        return;
+      /* FIXME: implement! */
+      g_vfs_job_failed (G_VFS_JOB (job),
+                        G_IO_ERROR,
+                        G_IO_ERROR_CANT_CREATE_BACKUP,
+                        _("Backups are not yet supported."));
+      return;
+    }
+
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_file_open (self->afc_cli,
+                                                         filename, AFC_FOPEN_WR, &fd),
+                                          G_VFS_JOB(job))))
+    {
+      return;
     }
 
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_file_open(
-                            self->afc_cli, filename, AFC_FOPEN_WR,
-                            &fd), G_VFS_JOB(job))))
-            return;
+  g_vfs_job_open_for_write_set_handle (job, GUINT_TO_POINTER((gulong)fd));
+  g_vfs_job_open_for_write_set_can_seek (job, TRUE);
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 
-    g_vfs_job_open_for_write_set_handle(job, GUINT_TO_POINTER((gulong)fd));
-    g_vfs_job_open_for_write_set_can_seek(job, TRUE);
-    g_vfs_job_succeeded(G_VFS_JOB(job));
-    return;
+  return;
 }
 
 /* Callback to close a file that was previously opened for reading. */
-static void g_vfs_backend_afc_close_read(GVfsBackend *backend,
-        GVfsJobCloseRead *job, GVfsBackendHandle handle)
+static void
+g_vfs_backend_afc_close_read (GVfsBackend *backend,
+                              GVfsJobCloseRead *job,
+                              GVfsBackendHandle handle)
 {
-    GVfsBackendAfc *self;
-    uint64_t fd = 0;
+  GVfsBackendAfc *self;
+  uint64_t fd = 0;
 
-    fd = GPOINTER_TO_UINT(handle);
-    g_return_if_fail(fd != 0);
+  fd = GPOINTER_TO_UINT(handle);
+  g_return_if_fail (fd != 0);
 
-    self = G_VFS_BACKEND_AFC(backend);
+  self = G_VFS_BACKEND_AFC(backend);
 
-    if (self->connected)
-        afc_file_close(self->afc_cli, fd);
+  if (self->connected)
+    afc_file_close (self->afc_cli, fd);
 
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
-static void g_vfs_backend_afc_close_write(GVfsBackend *backend,
-        GVfsJobCloseWrite *job, GVfsBackendHandle handle)
+static void
+g_vfs_backend_afc_close_write (GVfsBackend *backend,
+                               GVfsJobCloseWrite *job,
+                               GVfsBackendHandle handle)
 {
-    GVfsBackendAfc *self;
-    uint64_t fd = 0;
+  GVfsBackendAfc *self;
+  uint64_t fd = 0;
 
-    fd = GPOINTER_TO_UINT(handle);
-    g_return_if_fail(fd != 0);
+  fd = GPOINTER_TO_UINT(handle);
+  g_return_if_fail (fd != 0);
 
-    self = G_VFS_BACKEND_AFC(backend);
+  self = G_VFS_BACKEND_AFC(backend);
 
-    if (self->connected)
-        afc_file_close(self->afc_cli, fd);
+  if (self->connected)
+    afc_file_close(self->afc_cli, fd);
 
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
-static void g_vfs_backend_afc_read(GVfsBackend *backend, GVfsJobRead *job,
-        GVfsBackendHandle handle, char *buffer, gsize req)
+static void
+g_vfs_backend_afc_read (GVfsBackend *backend,
+                        GVfsJobRead *job,
+                        GVfsBackendHandle handle,
+                        char *buffer,
+                        gsize req)
 {
-    guint32 nread = 0;
-    GVfsBackendAfc *self;
-    uint64_t fd = 0;
+  guint32 nread = 0;
+  GVfsBackendAfc *self;
+  uint64_t fd = 0;
 
-    fd = GPOINTER_TO_UINT(handle);
-    g_return_if_fail(fd != 0);
+  fd = GPOINTER_TO_UINT(handle);
+  g_return_if_fail (fd != 0);
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
 
-    if (req > 0 && G_UNLIKELY(g_vfs_backend_afc_check(afc_file_read(
-                        self->afc_cli, fd, buffer, req, &nread),
-                    G_VFS_JOB(job)))) 
-        return;
+  if (req > 0 &&
+      G_UNLIKELY(g_vfs_backend_afc_check (afc_file_read (self->afc_cli,
+                                                         fd, buffer, req, &nread),
+                                          G_VFS_JOB(job)))) 
+    {
+      return;
+    }
 
-    g_vfs_job_read_set_size(job, nread);
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_job_read_set_size (job, nread);
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
-static void g_vfs_backend_afc_write(GVfsBackend *backend, GVfsJobWrite *job,
-        GVfsBackendHandle handle, char *buffer, gsize sz)
+static void
+g_vfs_backend_afc_write (GVfsBackend *backend,
+                         GVfsJobWrite *job,
+                         GVfsBackendHandle handle,
+                         char *buffer,
+                         gsize sz)
 {
-    guint32 nwritten = 0;
-    GVfsBackendAfc *self;
-    uint64_t fd = 0;
+  guint32 nwritten = 0;
+  GVfsBackendAfc *self;
+  uint64_t fd = 0;
 
-    fd = GPOINTER_TO_UINT(handle);
-    g_return_if_fail(fd != 0);
+  fd = GPOINTER_TO_UINT(handle);
+  g_return_if_fail (fd != 0);
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
 
-    if (sz > 0 && G_UNLIKELY(g_vfs_backend_afc_check(afc_file_write(
-                        self->afc_cli, fd, buffer, sz, &nwritten),
-                    G_VFS_JOB(job)))) 
-        return;
+  if (sz > 0 &&
+      G_UNLIKELY(g_vfs_backend_afc_check(afc_file_write (self->afc_cli,
+                                                         fd, buffer, sz, &nwritten),
+                                         G_VFS_JOB(job)))) 
+    {
+      return;
+    }
 
-    g_vfs_job_write_set_written_size(job, nwritten);
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_job_write_set_written_size (job, nwritten);
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
-static int g_vfs_backend_afc_seek(GVfsBackendAfc *self, GVfsJob *job,
-        GVfsBackendHandle handle, goffset offset, GSeekType type)
+static int
+g_vfs_backend_afc_seek (GVfsBackendAfc *self,
+                        GVfsJob *job,
+                        GVfsBackendHandle handle,
+                        goffset offset,
+                        GSeekType type)
 {
-    guint32 pos;
-    int afc_seek_type;
-    uint64_t fd = 0;
-
-    switch (type) {
-    case G_SEEK_SET:    afc_seek_type = SEEK_SET; break;
-    case G_SEEK_CUR:    afc_seek_type = SEEK_CUR; break;
-    case G_SEEK_END:    afc_seek_type = SEEK_END; break;
+  guint32 pos;
+  int afc_seek_type;
+  uint64_t fd = 0;
+
+  switch (type)
+    {
+    case G_SEEK_SET:
+      afc_seek_type = SEEK_SET;
+      break;
+    case G_SEEK_CUR:
+      afc_seek_type = SEEK_CUR;
+      break;
+    case G_SEEK_END:
+      afc_seek_type = SEEK_END;
+      break;
     default:
-        g_vfs_job_failed(job, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
-                _("Invalid seek type"));
-        return 1;
+      g_vfs_job_failed(job, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT,
+                       _("Invalid seek type"));
+      return 1;
     }
 
-    fd = GPOINTER_TO_UINT(handle);
+  fd = GPOINTER_TO_UINT(handle);
 
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_file_seek(self->afc_cli,
-                        fd, offset, afc_seek_type), job)))
-        return 1;
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_file_seek (self->afc_cli,
+                                                         fd, offset, afc_seek_type),
+                                          job)))
+    {
+      return 1;
+    }
 
-    return 0;
+  return 0;
 }
 
-static void g_vfs_backend_afc_seek_on_read(GVfsBackend *backend,
-        GVfsJobSeekRead *job, GVfsBackendHandle handle, goffset offset,
-        GSeekType type)
+static void
+g_vfs_backend_afc_seek_on_read (GVfsBackend *backend,
+                                GVfsJobSeekRead *job,
+                                GVfsBackendHandle handle,
+                                goffset offset,
+                                GSeekType type)
 {
-    GVfsBackendAfc *self;
+  GVfsBackendAfc *self;
 
-    g_return_if_fail(handle != NULL);
+  g_return_if_fail (handle != NULL);
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
 
-    if (!g_vfs_backend_afc_seek(self, G_VFS_JOB(job), handle, offset, type)) {
-        g_vfs_job_seek_read_set_offset(job, offset);
-        g_vfs_job_succeeded(G_VFS_JOB(job));
+  if (!g_vfs_backend_afc_seek (self, G_VFS_JOB(job), handle, offset, type))
+    {
+      g_vfs_job_seek_read_set_offset (job, offset);
+      g_vfs_job_succeeded (G_VFS_JOB(job));
     }
 }
 
-static void g_vfs_backend_afc_seek_on_write(GVfsBackend *backend,
-        GVfsJobSeekWrite *job, GVfsBackendHandle handle, goffset offset,
-        GSeekType type)
+static void
+g_vfs_backend_afc_seek_on_write (GVfsBackend *backend,
+                                 GVfsJobSeekWrite *job,
+                                 GVfsBackendHandle handle,
+                                 goffset offset,
+                                 GSeekType type)
 {
-    GVfsBackendAfc *self;
+  GVfsBackendAfc *self;
 
-    g_return_if_fail(handle != NULL);
+  g_return_if_fail (handle != NULL);
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
 
-    if (!g_vfs_backend_afc_seek(self, G_VFS_JOB(job), handle, offset, type)) {
-        g_vfs_job_seek_write_set_offset(job, offset);
-        g_vfs_job_succeeded(G_VFS_JOB(job));
+  if (!g_vfs_backend_afc_seek (self, G_VFS_JOB(job), handle, offset, type))
+    {
+      g_vfs_job_seek_write_set_offset (job, offset);
+      g_vfs_job_succeeded (G_VFS_JOB(job));
     }
 }
 
-static void g_vfs_backend_afc_set_info_from_afcinfo(GVfsBackendAfc *self,
-        GFileInfo *info, char **afcinfo, const char *basename,
-        GFileAttributeMatcher *matcher, GFileQueryInfoFlags flags)
+static void
+g_vfs_backend_afc_set_info_from_afcinfo (GVfsBackendAfc *self,
+                                         GFileInfo *info,
+                                         char **afcinfo,
+                                         const char *basename,
+                                         GFileAttributeMatcher *matcher,
+                                         GFileQueryInfoFlags flags)
 {
-    GFileType type;
-    GIcon *icon = NULL;
-    gchar *content_type = NULL;
-    char *display_name;
-    char *linktarget = NULL;
-    char **afctargetinfo = NULL;
-    int i;
-
-    /* get file attributes from info list */
-    for (i = 0; afcinfo[i]; i += 2) {
-        if (!strcmp(afcinfo[i], "st_size")) {
-            g_file_info_set_size(info, atoll(afcinfo[i+1]));
-        } else if (!strcmp(afcinfo[i], "st_blocks")) {
-            g_file_info_set_attribute_uint64(info, G_FILE_ATTRIBUTE_UNIX_BLOCKS, atoi(afcinfo[i+1]));
-        } else if (!strcmp(afcinfo[i], "st_ifmt")) {
-            if (!strcmp(afcinfo[i+1], "S_IFREG")) {
-                type = G_FILE_TYPE_REGULAR;
-            } else if (!strcmp(afcinfo[i+1], "S_IFDIR")) {
-                type = G_FILE_TYPE_DIRECTORY;
-            } else if (!strcmp(afcinfo[i+1], "S_IFLNK")) {
-                type = G_FILE_TYPE_SYMBOLIC_LINK;
-                content_type = g_strdup("inode/symlink");
-            } else if (!strcmp(afcinfo[i+1], "S_IFBLK")) {
-                type = G_FILE_TYPE_SPECIAL;
-                content_type = g_strdup("inode/blockdevice");
-            } else if (!strcmp(afcinfo[i+1], "S_IFCHR")) {
-                type = G_FILE_TYPE_SPECIAL;
-                content_type = g_strdup("inode/chardevice");
-            } else if (!strcmp(afcinfo[i+1], "S_IFIFO")) {
-                type = G_FILE_TYPE_SPECIAL;
-                content_type = g_strdup("inode/fifo");
-            } else if (!strcmp(afcinfo[i+1], "S_IFSOCK")) {
-                type = G_FILE_TYPE_SPECIAL;
-                content_type = g_strdup("inode/socket");
+  GFileType type;
+  GIcon *icon = NULL;
+  gchar *content_type = NULL;
+  char *display_name;
+  char *linktarget = NULL;
+  char **afctargetinfo = NULL;
+  int i;
+
+  /* get file attributes from info list */
+  for (i = 0; afcinfo[i]; i += 2)
+    {
+      if (afcinfo[i] == NULL)
+        continue;
+      if (g_str_equal (afcinfo[i], "st_size"))
+        {
+          g_file_info_set_size (info, atoll(afcinfo[i+1]));
+        } else if (g_str_equal (afcinfo[i], "st_blocks"))
+          {
+            g_file_info_set_attribute_uint64 (info, G_FILE_ATTRIBUTE_UNIX_BLOCKS, atoi(afcinfo[i+1]));
+          }
+      else if (g_str_equal (afcinfo[i], "st_ifmt"))
+        {
+          if (g_str_equal (afcinfo[i+1], "S_IFREG"))
+            {
+              type = G_FILE_TYPE_REGULAR;
+            }
+          else if (g_str_equal (afcinfo[i+1], "S_IFDIR"))
+            {
+              type = G_FILE_TYPE_DIRECTORY;
+            }
+          else if (g_str_equal (afcinfo[i+1], "S_IFLNK"))
+            {
+              type = G_FILE_TYPE_SYMBOLIC_LINK;
+              content_type = g_strdup ("inode/symlink");
             }
-            g_file_info_set_file_type(info, type);
-        } else if (!strcmp(afcinfo[i], "st_nlink")) {
-            g_file_info_set_attribute_uint32(info, G_FILE_ATTRIBUTE_UNIX_NLINK, atoi(afcinfo[i+1]));
-        } else if (!strcmp(afcinfo[i], "LinkTarget")) {
-            linktarget = g_strdup(afcinfo[i+1]);
-            g_file_info_set_symlink_target(info, linktarget);
-            g_file_info_set_is_symlink(info, TRUE);
+          else if (g_str_equal (afcinfo[i+1], "S_IFBLK"))
+            {
+              type = G_FILE_TYPE_SPECIAL;
+              content_type = g_strdup ("inode/blockdevice");
+            }
+          else if (g_str_equal (afcinfo[i+1], "S_IFCHR"))
+            {
+              type = G_FILE_TYPE_SPECIAL;
+              content_type = g_strdup ("inode/chardevice");
+            }
+          else if (g_str_equal (afcinfo[i+1], "S_IFIFO"))
+            {
+              type = G_FILE_TYPE_SPECIAL;
+              content_type = g_strdup ("inode/fifo");
+            }
+          else if (g_str_equal (afcinfo[i+1], "S_IFSOCK"))
+            {
+              type = G_FILE_TYPE_SPECIAL;
+              content_type = g_strdup ("inode/socket");
+            }
+          g_file_info_set_file_type (info, type);
+        }
+      else if (g_str_equal (afcinfo[i], "st_nlink"))
+        {
+          g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_NLINK, atoi(afcinfo[i+1]));
+        }
+      else if (g_str_equal (afcinfo[i], "LinkTarget"))
+        {
+          linktarget = g_strdup (afcinfo[i+1]);
+          g_file_info_set_symlink_target (info, linktarget);
+          g_file_info_set_is_symlink (info, TRUE);
         }
     }
 
-    /* and set some additional info */
-    g_file_info_set_attribute_uint32(info, G_FILE_ATTRIBUTE_UNIX_UID, getuid());
-    g_file_info_set_attribute_uint32(info, G_FILE_ATTRIBUTE_UNIX_GID, getgid());
-
-    /*
-     * Maybe this icon stuff should be moved out into a generic function? It
-     * seems a little funny to put this in the backends.
-     */
-    if (g_file_attribute_matcher_matches(matcher,
-                G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE)
-        || g_file_attribute_matcher_matches(matcher,
-            G_FILE_ATTRIBUTE_STANDARD_ICON)) {
-
-        if (type == G_FILE_TYPE_DIRECTORY) {
-            content_type = g_strdup("inode/directory");
-            icon = g_themed_icon_new("folder");
-        } else {
-            if (content_type == NULL)
-                content_type = g_content_type_guess(basename, NULL, 0, NULL);
-            if (content_type) {
-                icon = g_content_type_get_icon(content_type);
-                if (G_IS_THEMED_ICON(icon))
-                    g_themed_icon_append_name(G_THEMED_ICON(icon), "text-x-generic");
+  /* and set some additional info */
+  g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_UID, getuid ());
+  g_file_info_set_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_GID, getgid ());
+
+  /*
+   * Maybe this icon stuff should be moved out into a generic function? It
+   * seems a little funny to put this in the backends.
+   */
+  if (g_file_attribute_matcher_matches (matcher, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE)
+      || g_file_attribute_matcher_matches (matcher, G_FILE_ATTRIBUTE_STANDARD_ICON))
+    {
+      if (type == G_FILE_TYPE_DIRECTORY)
+        {
+          content_type = g_strdup ("inode/directory");
+          icon = g_themed_icon_new ("folder");
+        }
+      else
+        {
+          if (content_type == NULL)
+            content_type = g_content_type_guess (basename, NULL, 0, NULL);
+          if (content_type)
+            {
+              icon = g_content_type_get_icon (content_type);
+              if (G_IS_THEMED_ICON(icon))
+                g_themed_icon_append_name (G_THEMED_ICON(icon), "text-x-generic");
             }
         }
 
-        if (content_type) {
-            g_file_info_set_content_type(info, content_type);
-            g_free(content_type);
-        }
+      if (content_type)
+        g_file_info_set_content_type (info, content_type);
 
-        if (icon == NULL)
-            icon = g_themed_icon_new("text-x-generic");
+      if (icon == NULL)
+        icon = g_themed_icon_new ("text-x-generic");
 
-        g_file_info_set_icon(info, icon);
-        g_object_unref(icon);
+      g_file_info_set_icon (info, icon);
+      g_object_unref (icon);
     }
-    else if (content_type)
-        g_free(content_type);
-
-    /* for symlinks to work we need to return GFileInfo for the linktarget */
-    if ((flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) == 0) {
-        if (type == G_FILE_TYPE_SYMBOLIC_LINK) {
-            /* query the linktarget instead and merge the file info of it */
-            if(AFC_E_SUCCESS == afc_get_file_info(self->afc_cli, linktarget, &afctargetinfo)) {
-                g_vfs_backend_afc_set_info_from_afcinfo(self, info, afctargetinfo, linktarget, matcher, flags);
-            }
-            if (afctargetinfo)
-                g_strfreev(afctargetinfo);
+
+  g_free (content_type);
+
+  /* for symlinks to work we need to return GFileInfo for the linktarget */
+  if ((flags & G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS) == 0)
+    {
+      if (type == G_FILE_TYPE_SYMBOLIC_LINK)
+        {
+          /* query the linktarget instead and merge the file info of it */
+          if (AFC_E_SUCCESS == afc_get_file_info (self->afc_cli, linktarget, &afctargetinfo))
+            g_vfs_backend_afc_set_info_from_afcinfo (self, info, afctargetinfo, linktarget, matcher, flags);
+          if (afctargetinfo)
+            g_strfreev (afctargetinfo);
         }
     }
 
-    if (linktarget)
-        g_free(linktarget);
-
-    /* regardless of symlink recursion; still set the basename of the source */
-    g_file_info_set_name(info, basename);
-
-    /* handle root directory */
-    if (strcmp (basename, "/") == 0)
-        display_name = g_strdup(g_vfs_backend_get_display_name(G_VFS_BACKEND(self)));
-    else
-        display_name = g_filename_display_name(basename);
-
-    if (g_file_attribute_matcher_matches(matcher,
-                G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME))
-        g_file_info_set_display_name(info, display_name);
-    if (g_file_attribute_matcher_matches(matcher,
-                G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME))
-        g_file_info_set_edit_name(info, display_name);
-    g_free(display_name);
+  g_free (linktarget);
+
+  /* regardless of symlink recursion; still set the basename of the source */
+  g_file_info_set_name(info, basename);
+
+  /* handle root directory */
+  if (g_str_equal (basename, "/"))
+    display_name = g_strdup (g_vfs_backend_get_display_name (G_VFS_BACKEND(self)));
+  else
+    display_name = g_filename_display_name (basename);
+
+  if (g_file_attribute_matcher_matches (matcher, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME))
+    g_file_info_set_display_name (info, display_name);
+
+  if (g_file_attribute_matcher_matches (matcher, G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME))
+    g_file_info_set_edit_name (info, display_name);
+
+  g_free (display_name);
 }
 
 /* Callback for iterating over a directory. */
-static void g_vfs_backend_afc_enumerate(GVfsBackend *backend,
-        GVfsJobEnumerate *job, const char *path, GFileAttributeMatcher *
-        matcher, GFileQueryInfoFlags flags)
+static void
+g_vfs_backend_afc_enumerate (GVfsBackend *backend,
+                             GVfsJobEnumerate *job,
+                             const char *path,
+                             GFileAttributeMatcher *matcher,
+                             GFileQueryInfoFlags flags)
 {
-    struct stat st;
-    GFileInfo *info;
-    GVfsBackendAfc *self;
-    gboolean trailing_slash;
-    gchar *file_path;
-    char **ptr, **list = NULL;
-    char **afcinfo = NULL;
-
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
-
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_read_directory(
-                        self->afc_cli, path, &list), G_VFS_JOB(job))))
-        return;
+  struct stat st;
+  GFileInfo *info;
+  GVfsBackendAfc *self;
+  gboolean trailing_slash;
+  gchar *file_path;
+  char **ptr, **list = NULL;
+  char **afcinfo = NULL;
+
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
+
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_read_directory (self->afc_cli, path, &list),
+                                          G_VFS_JOB(job))))
+    {
+      return;
+    }
 
-    trailing_slash = g_str_has_suffix(path, "/");
-
-    for (ptr = list; *ptr; ptr++) {
-        if (!strcmp(*ptr, ".") || !strcmp(*ptr, ".."))
-            continue;
-
-        if (!trailing_slash)
-            file_path = g_strdup_printf("%s/%s", path, *ptr);
-        else
-            file_path = g_strdup_printf("%s%s", path, *ptr);
-
-        /*
-         * This call might fail if the file in question is removed while we're
-         * iterating over the directory list. In that case, just don't include
-         * it in the list.
-         */
-        if (G_LIKELY(afc_get_file_info(self->afc_cli, file_path, &afcinfo) == AFC_E_SUCCESS)) {
-            info = g_file_info_new();
-            g_vfs_backend_afc_set_info_from_afcinfo(self, info, afcinfo, *ptr, matcher, flags);
-            g_vfs_job_enumerate_add_info(job, info);
-            g_object_unref(G_OBJECT(info));
-            g_strfreev(afcinfo);
+  trailing_slash = g_str_has_suffix (path, "/");
+
+  for (ptr = list; *ptr; ptr++)
+    {
+      if (!strcmp(*ptr, ".") || !strcmp(*ptr, ".."))
+        continue;
+
+      if (!trailing_slash)
+        file_path = g_strdup_printf ("%s/%s", path, *ptr);
+      else
+        file_path = g_strdup_printf ("%s%s", path, *ptr);
+
+      /*
+       * This call might fail if the file in question is removed while we're
+       * iterating over the directory list. In that case, just don't include
+       * it in the list.
+       */
+      if (G_LIKELY(afc_get_file_info(self->afc_cli, file_path, &afcinfo) == AFC_E_SUCCESS))
+        {
+          info = g_file_info_new ();
+          g_vfs_backend_afc_set_info_from_afcinfo (self, info, afcinfo, *ptr, matcher, flags);
+          g_vfs_job_enumerate_add_info (job, info);
+          g_object_unref (G_OBJECT(info));
+          g_strfreev (afcinfo);
         }
 
-        g_free(file_path);
+      g_free (file_path);
     }
 
-    g_strfreev(list);
+  g_strfreev (list);
 
-    g_vfs_job_enumerate_done(job);
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_job_enumerate_done (job);
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
-static void g_vfs_backend_afc_query_info(GVfsBackend *backend,
-        GVfsJobQueryInfo *job, const char *path, GFileQueryInfoFlags flags,
-        GFileInfo *info, GFileAttributeMatcher *matcher)
+static void
+g_vfs_backend_afc_query_info (GVfsBackend *backend,
+                              GVfsJobQueryInfo *job,
+                              const char *path,
+                              GFileQueryInfoFlags flags,
+                              GFileInfo *info,
+                              GFileAttributeMatcher *matcher)
 {
-    GVfsBackendAfc *self;
-    struct stat st;
-    const char *basename, *ptr;
-    afc_error_t res;
-    char **afcinfo = NULL;
-
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
-
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_get_file_info(self->afc_cli,
-                                           path, &afcinfo), G_VFS_JOB(job)))) {
-        if (afcinfo)
-            g_strfreev(afcinfo);
-        return;
-    }
+  GVfsBackendAfc *self;
+  struct stat st;
+  const char *basename, *ptr;
+  afc_error_t res;
+  char **afcinfo = NULL;
 
-    ptr = strrchr(path, '/');
-    if (ptr && ptr[1] != '\0')
-        basename = ptr + 1;
-    else
-        basename = path;
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
 
-    g_vfs_backend_afc_set_info_from_afcinfo(self, info, afcinfo, basename, matcher, flags);
-    if (afcinfo)
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_get_file_info (self->afc_cli, path, &afcinfo),
+                                          G_VFS_JOB(job))))
+    {
+      if (afcinfo)
         g_strfreev(afcinfo);
+      return;
+    }
+
+  ptr = strrchr (path, '/');
+  if (ptr && ptr[1] != '\0')
+    basename = ptr + 1;
+  else
+    basename = path;
 
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_backend_afc_set_info_from_afcinfo (self, info, afcinfo, basename, matcher, flags);
+  if (afcinfo)
+    g_strfreev (afcinfo);
+
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
 /*
@@ -899,202 +1048,235 @@ static void g_vfs_backend_afc_query_info(GVfsBackend *backend,
  *   FSFreeBytes: free space on drive
  *   FSBlockSize: block granularity
  */
-static void g_vfs_backend_afc_query_fs_info(GVfsBackend *backend,
-        GVfsJobQueryFsInfo *job, const char *path, GFileInfo *info,
-        GFileAttributeMatcher *matcher)
+static void
+g_vfs_backend_afc_query_fs_info (GVfsBackend *backend,
+                                 GVfsJobQueryFsInfo *job,
+                                 const char *path,
+                                 GFileInfo *info,
+                                 GFileAttributeMatcher *matcher)
 {
-    GVfsBackendAfc *self;
-    char **kvps, **ptr;
-    uint64_t totalspace = 0, freespace = 0;
-    int blocksize = 0;
-
-    self = G_VFS_BACKEND_AFC(backend);
-
-    g_file_info_set_attribute_string(info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE,
-            "afc");
-   
-    if (self->connected) {
-        if (G_UNLIKELY(g_vfs_backend_afc_check(afc_get_device_info(
-                            self->afc_cli, &kvps), G_VFS_JOB(job))))
-            return;
-
-        for (ptr = kvps; *ptr; ptr++) {
-            if (!strcmp(*ptr, "FSTotalBytes")) {
-                totalspace = g_ascii_strtoull(*(ptr+1), (char **) NULL, 10);
-            } else if (!strcmp(*ptr, "FSFreeBytes")) {
-                freespace = g_ascii_strtoull(*(ptr+1), (char **) NULL, 10);
-            } else if (!strcmp(*ptr, "FSBlockSize")) {
-                blocksize = atoi(*(ptr+1));
+  GVfsBackendAfc *self;
+  char **kvps, **ptr;
+  uint64_t totalspace = 0, freespace = 0;
+  int blocksize = 0;
+
+  self = G_VFS_BACKEND_AFC(backend);
+
+  g_file_info_set_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE, "afc");
+
+  if (self->connected)
+    {
+      if (G_UNLIKELY(g_vfs_backend_afc_check (afc_get_device_info (self->afc_cli, &kvps), G_VFS_JOB(job))))
+        return;
+
+      for (ptr = kvps; *ptr; ptr++)
+        {
+          if (g_str_equal (*ptr, "FSTotalBytes"))
+            {
+              totalspace = g_ascii_strtoull (*(ptr+1), (char **) NULL, 10);
+            }
+          else if (g_str_equal (*ptr, "FSFreeBytes"))
+            {
+              freespace = g_ascii_strtoull (*(ptr+1), (char **) NULL, 10);
+            }
+          else if (g_str_equal (*ptr, "FSBlockSize"))
+            {
+              blocksize = atoi (*(ptr+1));
             }
         }
 
-        g_strfreev(kvps);
-
-        g_file_info_set_attribute_uint32 (info,
-                                          G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE, 
-                                          (guint32) blocksize);
-        g_file_info_set_attribute_uint64 (info, 
-                                          G_FILE_ATTRIBUTE_FILESYSTEM_SIZE, 
-                                          (guint64) totalspace);
-        g_file_info_set_attribute_uint64 (info, 
-                                          G_FILE_ATTRIBUTE_FILESYSTEM_FREE, 
-                                          (guint64) freespace);
-        g_file_info_set_attribute_boolean (info, 
-                                          G_FILE_ATTRIBUTE_FILESYSTEM_READONLY, 
-                                          FALSE);
-        g_file_info_set_attribute_uint32 (info,
-                                          G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, 
-                                          G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL);
+      g_strfreev (kvps);
+
+      g_file_info_set_attribute_uint32 (info,
+                                        G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE, 
+                                        (guint32) blocksize);
+      g_file_info_set_attribute_uint64 (info, 
+                                        G_FILE_ATTRIBUTE_FILESYSTEM_SIZE, 
+                                        (guint64) totalspace);
+      g_file_info_set_attribute_uint64 (info, 
+                                        G_FILE_ATTRIBUTE_FILESYSTEM_FREE, 
+                                        (guint64) freespace);
+      g_file_info_set_attribute_boolean (info, 
+                                         G_FILE_ATTRIBUTE_FILESYSTEM_READONLY, 
+                                         FALSE);
+      g_file_info_set_attribute_uint32 (info,
+                                        G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, 
+                                        G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL);
     }
 
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
-static void g_vfs_backend_afc_set_display_name (GVfsBackend *backend,
-		     GVfsJobSetDisplayName *job,
-		     const char *filename,
-		     const char *display_name)
+static void
+g_vfs_backend_afc_set_display_name (GVfsBackend *backend,
+                                    GVfsJobSetDisplayName *job,
+                                    const char *filename,
+                                    const char *display_name)
 {
-    GVfsBackendAfc *self;
+  GVfsBackendAfc *self;
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
 
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_rename_path(self->afc_cli,
-                        filename, display_name), G_VFS_JOB(job))))
-        return;
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_rename_path (self->afc_cli,
+                                                           filename, display_name),
+                                          G_VFS_JOB(job))))
+    {
+      return;
+    }
 
-    g_vfs_job_set_display_name_set_new_path (job, display_name);
+  g_vfs_job_set_display_name_set_new_path (job, display_name);
 
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
-static void g_vfs_backend_afc_make_directory(GVfsBackend *backend,
-        GVfsJobMakeDirectory *job, const char *path)
+static void
+g_vfs_backend_afc_make_directory (GVfsBackend *backend,
+                                  GVfsJobMakeDirectory *job,
+                                  const char *path)
 {
-    GVfsBackendAfc *self;
+  GVfsBackendAfc *self;
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail(self->connected);
 
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_make_directory(self->afc_cli,
-                        path), G_VFS_JOB(job))))
-        return;
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_make_directory (self->afc_cli,
+                                                              path),
+                                          G_VFS_JOB(job))))
+    {
+      return;
+    }
 
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
-static void g_vfs_backend_afc_make_symlink(GVfsBackend *backend,
-	 GVfsJobMakeSymlink *job,
-	 const char *filename,
-	 const char *symlink_value)
+static void
+g_vfs_backend_afc_make_symlink (GVfsBackend *backend,
+                                GVfsJobMakeSymlink *job,
+                                const char *filename,
+                                const char *symlink_value)
 {
-    GVfsBackendAfc *self;
+  GVfsBackendAfc *self;
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
 
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_make_link(self->afc_cli,
-                        AFC_SYMLINK, symlink_value, filename), G_VFS_JOB(job))))
-        return;
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_make_link (self->afc_cli,
+                                                         AFC_SYMLINK, symlink_value, filename),
+                                          G_VFS_JOB(job))))
+    {
+      return;
+    }
 
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
-static void g_vfs_backend_afc_move(GVfsBackend *backend,
-	 GVfsJobMove *job,
-	 const char *source,
-	 const char *destination,
-	 GFileCopyFlags flags,
-	 GFileProgressCallback progress_callback,
-	 gpointer progress_callback_data)
+static void
+g_vfs_backend_afc_move (GVfsBackend *backend,
+                        GVfsJobMove *job,
+                        const char *source,
+                        const char *destination,
+                        GFileCopyFlags flags,
+                        GFileProgressCallback progress_callback,
+                        gpointer progress_callback_data)
 {
-    GVfsBackendAfc *self;
+  GVfsBackendAfc *self;
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
 
   if (flags & G_FILE_COPY_BACKUP)
     {
       /* FIXME: implement! */
       g_vfs_job_failed (G_VFS_JOB (job),
-			G_IO_ERROR,
-			G_IO_ERROR_CANT_CREATE_BACKUP,
-			_("backups not supported yet"));
+                        G_IO_ERROR,
+                        G_IO_ERROR_CANT_CREATE_BACKUP,
+                        _("backups not supported yet"));
       return;
     }
 
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_rename_path(self->afc_cli,
-                        source, destination), G_VFS_JOB(job))))
-        return;
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_rename_path (self->afc_cli,
+                                                           source, destination),
+                                          G_VFS_JOB(job))))
+    {
+      return;
+    }
 
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
-static void g_vfs_backend_afc_delete(GVfsBackend *backend,
-	   GVfsJobDelete *job,
-	   const char *filename)
+static void
+g_vfs_backend_afc_delete (GVfsBackend *backend,
+                          GVfsJobDelete *job,
+                          const char *filename)
 {
-    GVfsBackendAfc *self;
+  GVfsBackendAfc *self;
 
-    self = G_VFS_BACKEND_AFC(backend);
-    g_return_if_fail(self->connected);
+  self = G_VFS_BACKEND_AFC(backend);
+  g_return_if_fail (self->connected);
 
-    if (G_UNLIKELY(g_vfs_backend_afc_check(afc_remove_path(self->afc_cli,
-                        filename), G_VFS_JOB(job))))
-        return;
+  if (G_UNLIKELY(g_vfs_backend_afc_check (afc_remove_path (self->afc_cli,
+                                                           filename),
+                                          G_VFS_JOB(job))))
+    {
+      return;
+    }
 
-    g_vfs_job_succeeded(G_VFS_JOB(job));
+  g_vfs_job_succeeded (G_VFS_JOB(job));
 }
 
 
-static void g_vfs_backend_afc_finalize(GObject *obj)
+static void
+g_vfs_backend_afc_finalize (GObject *obj)
 {
-    GVfsBackendAfc *self;
+  GVfsBackendAfc *self;
 
-    self = G_VFS_BACKEND_AFC(obj);
-    g_vfs_backend_afc_close_connection(self);
+  self = G_VFS_BACKEND_AFC(obj);
+  g_vfs_backend_afc_close_connection (self);
 
-    if (G_OBJECT_CLASS(g_vfs_backend_afc_parent_class)->finalize)
-        (*G_OBJECT_CLASS(g_vfs_backend_afc_parent_class)->finalize)(obj);
+  if (G_OBJECT_CLASS(g_vfs_backend_afc_parent_class)->finalize)
+    (*G_OBJECT_CLASS(g_vfs_backend_afc_parent_class)->finalize) (obj);
 }
 
-static void g_vfs_backend_afc_init(GVfsBackendAfc *self)
+static void
+g_vfs_backend_afc_init (GVfsBackendAfc *self)
 {
-    if (g_getenv("GVFS_DEBUG") != NULL) {
-        /* enable full debugging */
-        iphone_set_debug_level(1);
-        iphone_set_debug_mask(DBGMASK_ALL);
+  if (g_getenv ("GVFS_DEBUG") != NULL)
+    {
+      /* enable full debugging */
+      iphone_set_debug_level (1);
+      iphone_set_debug_mask (DBGMASK_ALL);
     }
 }
 
-static void g_vfs_backend_afc_class_init(GVfsBackendAfcClass *klass)
+static void
+g_vfs_backend_afc_class_init (GVfsBackendAfcClass *klass)
 {
-    GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-    GVfsBackendClass *backend_class = G_VFS_BACKEND_CLASS(klass);
-
-    gobject_class->finalize = g_vfs_backend_afc_finalize;
-
-    backend_class->mount            = g_vfs_backend_afc_mount;
-    backend_class->unmount          = g_vfs_backend_afc_unmount;
-    backend_class->open_for_read    = g_vfs_backend_afc_open_for_read;
-    backend_class->close_read       = g_vfs_backend_afc_close_read;
-    backend_class->read             = g_vfs_backend_afc_read;
-    backend_class->seek_on_read     = g_vfs_backend_afc_seek_on_read;
-    backend_class->create           = g_vfs_backend_afc_create;
-    backend_class->append_to        = g_vfs_backend_afc_append_to;
-    backend_class->replace          = g_vfs_backend_afc_replace;
-    backend_class->close_write      = g_vfs_backend_afc_close_write;
-    backend_class->write            = g_vfs_backend_afc_write;
-    backend_class->seek_on_write    = g_vfs_backend_afc_seek_on_write;
-    backend_class->enumerate        = g_vfs_backend_afc_enumerate;
-    backend_class->query_info       = g_vfs_backend_afc_query_info;
-    backend_class->query_fs_info    = g_vfs_backend_afc_query_fs_info;
-    backend_class->make_directory   = g_vfs_backend_afc_make_directory;
-    backend_class->delete           = g_vfs_backend_afc_delete;
-    backend_class->make_symlink     = g_vfs_backend_afc_make_symlink;
-    backend_class->move             = g_vfs_backend_afc_move;
-    backend_class->set_display_name = g_vfs_backend_afc_set_display_name;
+  GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+  GVfsBackendClass *backend_class = G_VFS_BACKEND_CLASS(klass);
+
+  gobject_class->finalize = g_vfs_backend_afc_finalize;
+
+  backend_class->mount            = g_vfs_backend_afc_mount;
+  backend_class->unmount          = g_vfs_backend_afc_unmount;
+  backend_class->open_for_read    = g_vfs_backend_afc_open_for_read;
+  backend_class->close_read       = g_vfs_backend_afc_close_read;
+  backend_class->read             = g_vfs_backend_afc_read;
+  backend_class->seek_on_read     = g_vfs_backend_afc_seek_on_read;
+  backend_class->create           = g_vfs_backend_afc_create;
+  backend_class->append_to        = g_vfs_backend_afc_append_to;
+  backend_class->replace          = g_vfs_backend_afc_replace;
+  backend_class->close_write      = g_vfs_backend_afc_close_write;
+  backend_class->write            = g_vfs_backend_afc_write;
+  backend_class->seek_on_write    = g_vfs_backend_afc_seek_on_write;
+  backend_class->enumerate        = g_vfs_backend_afc_enumerate;
+  backend_class->query_info       = g_vfs_backend_afc_query_info;
+  backend_class->query_fs_info    = g_vfs_backend_afc_query_fs_info;
+  backend_class->make_directory   = g_vfs_backend_afc_make_directory;
+  backend_class->delete           = g_vfs_backend_afc_delete;
+  backend_class->make_symlink     = g_vfs_backend_afc_make_symlink;
+  backend_class->move             = g_vfs_backend_afc_move;
+  backend_class->set_display_name = g_vfs_backend_afc_set_display_name;
 }
 
 /*
diff --git a/daemon/gvfsbackendafc.h b/daemon/gvfsbackendafc.h
index 0ecb917..6291180 100644
--- a/daemon/gvfsbackendafc.h
+++ b/daemon/gvfsbackendafc.h
@@ -13,19 +13,11 @@
 G_BEGIN_DECLS
 
 #define G_VFS_TYPE_BACKEND_AFC   (g_vfs_backend_afc_get_type())
-#define G_VFS_BACKEND_AFC(o) \
-    (G_TYPE_CHECK_INSTANCE_CAST((o), G_VFS_TYPE_BACKEND_AFC, \
-                                GVfsBackendAfc))
-#define G_VFS_BACKEND_AFC_CLASS(k) \
-    (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_BACKEND_AFC, \
-                             GVfsBackendAfcClass))
-#define G_VFS_IS_BACKEND_AFC(o) \
-    (G_TYPE_CHECK_INSTANCE_TYPE((o), G_VFS_TYPE_BACKEND_AFC))
-#define G_VFS_IS_BACKEND_AFC_CLASS(k) \
-    (G_TYPE_CHECK_CLASS_TYPE((k), G_VFS_TYPE_BACKEND_AFC))
-#define G_VFS_BACKEND_AFC_GET_CLASS(o) \
-    (G_TYPE_INSTANCE_GET_CLASS((o), G_VFS_TYPE_BACKEND_AFC, \
-                               GVfsBackendAfcClass))
+#define G_VFS_BACKEND_AFC(o) (G_TYPE_CHECK_INSTANCE_CAST((o), G_VFS_TYPE_BACKEND_AFC, GVfsBackendAfc))
+#define G_VFS_BACKEND_AFC_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_BACKEND_AFC, GVfsBackendAfcClass))
+#define G_VFS_IS_BACKEND_AFC(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), G_VFS_TYPE_BACKEND_AFC))
+#define G_VFS_IS_BACKEND_AFC_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), G_VFS_TYPE_BACKEND_AFC))
+#define G_VFS_BACKEND_AFC_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), G_VFS_TYPE_BACKEND_AFC, GVfsBackendAfcClass))
 
 typedef struct _GVfsBackendAfc GVfsBackendAfc;
 typedef struct _GVfsBackendAfcClass GVfsBackendAfcClass;
@@ -34,11 +26,11 @@ struct _GVfsBackendAfcClass {
     GVfsBackendClass parent_class;
 };
 
-GType g_vfs_backend_afc_get_type(void) G_GNUC_CONST;
+GType g_vfs_backend_afc_get_type (void) G_GNUC_CONST;
 
 G_END_DECLS
 
-#endif
+#endif /* GVFSBACKENDAFC_H */
 
 /*
  * vim: sw=2 ts=8 cindent expandtab cinoptions=f0,>4,n2,{2,(0,^-2,t0 ai
diff --git a/monitor/afc/afc-volume-monitor.c b/monitor/afc/afc-volume-monitor.c
index 262ac6a..30fa5a5 100644
--- a/monitor/afc/afc-volume-monitor.c
+++ b/monitor/afc/afc-volume-monitor.c
@@ -17,170 +17,186 @@
 #include "afc-volume-monitor.h"
 
 struct _GVfsAfcVolumeMonitor {
-    GNativeVolumeMonitor parent;
-    DBusConnection *dbus;
-    LibHalContext *ctx;
-    GList *volumes;
+  GNativeVolumeMonitor parent;
+  DBusConnection *dbus;
+  LibHalContext *ctx;
+  GList *volumes;
 };
 
-G_DEFINE_TYPE(GVfsAfcVolumeMonitor, g_vfs_afc_volume_monitor,
-        G_TYPE_VOLUME_MONITOR)
+G_DEFINE_TYPE(GVfsAfcVolumeMonitor, g_vfs_afc_volume_monitor, G_TYPE_VOLUME_MONITOR)
 
-static void g_vfs_afc_monitor_create_volume(GVfsAfcVolumeMonitor *self, const
-        char *udi)
+static void
+g_vfs_afc_monitor_create_volume (GVfsAfcVolumeMonitor *self,
+                                 const char *udi)
 {
-    DBusError err;
-    GVfsAfcVolume *volume = NULL;
-    gchar *uuid = NULL;
+  DBusError err;
+  GVfsAfcVolume *volume = NULL;
+  gchar *uuid = NULL;
 
-    dbus_error_init(&err);
+  dbus_error_init(&err);
 
-    uuid = (gchar*)libhal_device_get_property_string (self->ctx, udi, "usb.serial", &err);
-    if (!uuid) {
-	g_print("ERROR: could not get device uuid!\n");
-	return;
+  uuid = libhal_device_get_property_string (self->ctx, udi, "usb.serial", &err);
+  if (!uuid)
+    {
+      g_print ("ERROR: could not get device uuid!\n");
+      return;
     }
 
-    g_print("creating volume for device uuid '%s'\n", uuid);
+  g_print ("creating volume for device uuid '%s'\n", uuid);
 
-    volume = g_vfs_afc_volume_new(G_VOLUME_MONITOR (self), udi, uuid);
-    if (volume != NULL) {
-	self->volumes = g_list_prepend(self->volumes, volume);
-	g_signal_emit_by_name(self, "volume-added", volume);
+  volume = g_vfs_afc_volume_new (G_VOLUME_MONITOR (self), udi, uuid);
+  if (volume != NULL)
+    {
+      self->volumes = g_list_prepend (self->volumes, volume);
+      g_signal_emit_by_name (self, "volume-added", volume);
     }
 
-    if (uuid != NULL) {
-	g_free (uuid);
-    }
+  if (uuid != NULL)
+    g_free (uuid);
 }
 
-static GVfsAfcVolume *find_volume_by_uuid(GVfsAfcVolumeMonitor *self, const char * uuid)
+static GVfsAfcVolume *
+find_volume_by_uuid (GVfsAfcVolumeMonitor *self,
+                     const char * uuid)
 {
-    GList *l;
+  GList *l;
 
-    for (l = self->volumes; l != NULL; l = l->next) {
-	GVfsAfcVolume *volume = l->data;
-	if (volume && g_vfs_afc_volume_has_uuid(volume, uuid)) {
-	    return volume;
-	}
+  for (l = self->volumes; l != NULL; l = l->next)
+    {
+      GVfsAfcVolume *volume = l->data;
+      if (volume && g_vfs_afc_volume_has_uuid (volume, uuid))
+        return volume;
     }
 
-    return NULL;
+  return NULL;
 }
 
-static GVfsAfcVolume *find_volume_by_udi(GVfsAfcVolumeMonitor *self, const char * udi)
+static GVfsAfcVolume *
+find_volume_by_udi (GVfsAfcVolumeMonitor *self,
+                    const char * udi)
 {
-    DBusError err;
-    GVfsAfcVolume *volume = NULL;
-    gchar *uuid = NULL;
-    GFile *activation_mount_root = NULL; 
-    gchar *uri;
-
-    GList *l;
-
-    for (l = self->volumes; l != NULL; l = l->next) {
-	GVfsAfcVolume *volume = l->data;
-	if (volume) {
-	    if (g_strcmp0(g_vfs_afc_volume_get_udi(volume), udi) == 0)
-	        return volume;
-	}
+  DBusError err;
+  GVfsAfcVolume *volume = NULL;
+  gchar *uuid = NULL;
+  GFile *activation_mount_root = NULL; 
+  gchar *uri;
+
+  GList *l;
+
+  for (l = self->volumes; l != NULL; l = l->next)
+    {
+      GVfsAfcVolume *volume = l->data;
+      if (volume)
+        {
+          //FIXME leaking udi from g_vfs_afc_volume_get_udi
+          if (g_strcmp0 (g_vfs_afc_volume_get_udi (volume), udi) == 0)
+            return volume;
+        }
     }
 
-    return volume;
+  return volume;
 }
 
-static void g_vfs_afc_monitor_remove_volume(GVfsAfcVolumeMonitor *self, const
-        char *udi)
+static void
+g_vfs_afc_monitor_remove_volume (GVfsAfcVolumeMonitor *self,
+                                 const char *udi)
 {
-    GVfsAfcVolume *volume = NULL;
-    GFile *activation_mount_root = NULL; 
-    gchar *uri;
-
-    volume = find_volume_by_udi(self, udi);
-    if (volume != NULL) {
-       g_print("removing volume for device udi '%s'\n", udi);
-	self->volumes = g_list_remove(self->volumes, volume);
-	g_signal_emit_by_name(self, "volume-removed", volume);
+  GVfsAfcVolume *volume = NULL;
+  GFile *activation_mount_root = NULL; 
+  gchar *uri;
+
+  volume = find_volume_by_udi (self, udi);
+  if (volume != NULL)
+    {
+      g_print ("removing volume for device udi '%s'\n", udi);
+      self->volumes = g_list_remove (self->volumes, volume);
+      g_signal_emit_by_name (self, "volume-removed", volume);
     }
 }
 
-static void g_vfs_afc_monitor_device_added(LibHalContext *ctx, const char *udi)
+static void
+g_vfs_afc_monitor_device_added (LibHalContext *ctx,
+                                const char *udi)
 {
-    DBusError err;
-    GVfsAfcVolumeMonitor *self;
+  DBusError err;
+  GVfsAfcVolumeMonitor *self;
 
-    self = G_VFS_AFC_VOLUME_MONITOR(libhal_ctx_get_user_data(ctx));
+  self = G_VFS_AFC_VOLUME_MONITOR(libhal_ctx_get_user_data (ctx));
 
-    dbus_error_init(&err);
+  dbus_error_init (&err);
 
-    if (libhal_device_query_capability(ctx, udi, "afc", &err))
-        g_vfs_afc_monitor_create_volume(self, udi);
+  if (libhal_device_query_capability (ctx, udi, "afc", &err))
+    g_vfs_afc_monitor_create_volume (self, udi);
 }
 
-static void g_vfs_afc_monitor_device_removed(LibHalContext *ctx, const char *udi)
+static void
+g_vfs_afc_monitor_device_removed (LibHalContext *ctx,
+                                  const char *udi)
 {
-    DBusError err;
-    GVfsAfcVolumeMonitor *self;
+  DBusError err;
+  GVfsAfcVolumeMonitor *self;
 
-    self = G_VFS_AFC_VOLUME_MONITOR(libhal_ctx_get_user_data(ctx));
+  self = G_VFS_AFC_VOLUME_MONITOR(libhal_ctx_get_user_data(ctx));
 
-    dbus_error_init(&err);
+  dbus_error_init (&err);
 
-    g_vfs_afc_monitor_remove_volume(self, udi);
+  g_vfs_afc_monitor_remove_volume (self, udi);
 }
 
-static GObject *g_vfs_afc_volume_monitor_constructor(GType type, guint ncps,
-        GObjectConstructParam *cps)
+static GObject *
+g_vfs_afc_volume_monitor_constructor (GType type, guint ncps,
+                                      GObjectConstructParam *cps)
 {
-    DBusError err;
-    GVfsAfcVolumeMonitor *self;
-    int num_devices;
-    char **udis;
-
-    /* Boilerplate code to chain from parent. */
-    self = G_VFS_AFC_VOLUME_MONITOR((*G_OBJECT_CLASS(
-                    g_vfs_afc_volume_monitor_parent_class)->constructor)(type,
-                    ncps, cps));
-
-    dbus_error_init(&err);
-    self->dbus = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
-    if (dbus_error_is_set(&err)) {
-        fprintf(stderr, "D-Bus failed\n");
-        goto out;
+  DBusError err;
+  GVfsAfcVolumeMonitor *self;
+  int num_devices;
+  char **udis;
+
+  /* Boilerplate code to chain from parent. */
+  self = G_VFS_AFC_VOLUME_MONITOR((*G_OBJECT_CLASS(g_vfs_afc_volume_monitor_parent_class)->constructor)(type, ncps, cps));
+
+  dbus_error_init (&err);
+  self->dbus = dbus_bus_get (DBUS_BUS_SYSTEM, &err);
+  if (dbus_error_is_set (&err))
+    {
+      g_warning ("D-Bus failed\n");
+      goto out;
     }
 
-    self->ctx = libhal_ctx_new();
+  self->ctx = libhal_ctx_new ();
 
-    libhal_ctx_set_dbus_connection(self->ctx, self->dbus);
-    _g_dbus_connection_integrate_with_main(self->dbus);
+  libhal_ctx_set_dbus_connection (self->ctx, self->dbus);
+  _g_dbus_connection_integrate_with_main (self->dbus);
 
-    libhal_ctx_set_device_added(self->ctx, g_vfs_afc_monitor_device_added);
-    libhal_ctx_set_device_removed(self->ctx, g_vfs_afc_monitor_device_removed);
-    libhal_ctx_set_user_data(self->ctx, self);
+  libhal_ctx_set_device_added (self->ctx, g_vfs_afc_monitor_device_added);
+  libhal_ctx_set_device_removed (self->ctx, g_vfs_afc_monitor_device_removed);
+  libhal_ctx_set_user_data (self->ctx, self);
 
-    libhal_ctx_init(self->ctx, &err);
-    if (dbus_error_is_set(&err)) {
-        fprintf(stderr, "Couldn't initialize the libhal context\n");
-        goto out;
+  libhal_ctx_init (self->ctx, &err);
+  if (dbus_error_is_set(&err))
+    {
+      g_warning ("Couldn't initialize the libhal context\n");
+      goto out;
     }
 
-    self->volumes = NULL;
+  self->volumes = NULL;
 
-    udis = libhal_find_device_by_capability (self->ctx, "afc", &num_devices, NULL);
-    if (udis != NULL) {
+  udis = libhal_find_device_by_capability (self->ctx, "afc", &num_devices, NULL);
+  if (udis != NULL)
+    {
       guint i;
       for (i = 0; i < num_devices; i++)
         g_vfs_afc_monitor_device_added (self->ctx, udis[i]);
       libhal_free_string_array (udis);
     }
 
-    fprintf(stderr, "Volume monitor alive\n");
+  g_print ("Volume monitor alive\n");
 
-    return G_OBJECT(self);
+  return G_OBJECT(self);
 
 out:
-    g_object_unref(G_OBJECT(self));
-    return NULL;
+  g_object_unref (G_OBJECT(self));
+  return NULL;
 }
 
 static void
@@ -190,108 +206,111 @@ list_free (GList *objects)
   g_list_free (objects);
 }
 
-static void g_vfs_afc_volume_monitor_finalize(GObject *_self)
+static void
+g_vfs_afc_volume_monitor_finalize (GObject *_self)
 {
-    GVfsAfcVolumeMonitor *self;
-    DBusError err;
+  GVfsAfcVolumeMonitor *self;
+  DBusError err;
 
-    self = G_VFS_AFC_VOLUME_MONITOR(_self);
+  self = G_VFS_AFC_VOLUME_MONITOR(_self);
 
-    dbus_error_init(&err);
+  dbus_error_init(&err);
 
-    if (self->volumes) {
-	list_free(self->volumes);
-    }
+  if (self->volumes)
+    list_free(self->volumes);
 
-    if (self->ctx) {
-        libhal_ctx_shutdown(self->ctx, &err);
-        libhal_ctx_free(self->ctx);
-        self->ctx = NULL;
+  if (self->ctx)
+    {
+      libhal_ctx_shutdown (self->ctx, &err);
+      libhal_ctx_free (self->ctx);
+      self->ctx = NULL;
     }
 
-    if (G_OBJECT_CLASS(g_vfs_afc_volume_monitor_parent_class)->finalize)
-        (*G_OBJECT_CLASS(g_vfs_afc_volume_monitor_parent_class)->finalize)(
-                G_OBJECT(self));
+  if (G_OBJECT_CLASS(g_vfs_afc_volume_monitor_parent_class)->finalize)
+    (*G_OBJECT_CLASS(g_vfs_afc_volume_monitor_parent_class)->finalize)( G_OBJECT(self));
 }
 
-static GList *g_vfs_afc_volume_monitor_get_mounts(GVolumeMonitor *_self)
+static GList *
+g_vfs_afc_volume_monitor_get_mounts (GVolumeMonitor *_self)
 {
-    return NULL;
+  return NULL;
 }
 
-static GList *g_vfs_afc_volume_monitor_get_volumes(GVolumeMonitor *_self)
+static GList *
+g_vfs_afc_volume_monitor_get_volumes (GVolumeMonitor *_self)
 {
-    GVfsAfcVolumeMonitor *self;
-    GList *l;
+  GVfsAfcVolumeMonitor *self;
+  GList *l;
 
-    self = G_VFS_AFC_VOLUME_MONITOR (_self);
+  self = G_VFS_AFC_VOLUME_MONITOR (_self);
 
-    l = g_list_copy (self->volumes);
-    g_list_foreach (l, (GFunc)g_object_ref, NULL);
+  l = g_list_copy (self->volumes);
+  g_list_foreach (l, (GFunc)g_object_ref, NULL);
 
   return l;
 }
 
-static GList *g_vfs_afc_volume_monitor_get_connected_drives(GVolumeMonitor *
-        _self)
+static GList *
+g_vfs_afc_volume_monitor_get_connected_drives (GVolumeMonitor *_self)
 {
-    return NULL;
+  return NULL;
 }
 
-static GVolume *g_vfs_afc_volume_monitor_get_volume_for_uuid(GVolumeMonitor *
-        _self, const char *uuid)
+static GVolume *
+g_vfs_afc_volume_monitor_get_volume_for_uuid (GVolumeMonitor *_self,
+                                              const char *uuid)
 {
-    return NULL;
+  return NULL;
 }
 
-static GMount *g_vfs_afc_volume_monitor_get_mount_for_uuid(GVolumeMonitor *
-        _self, const char *uuid)
+static GMount *
+g_vfs_afc_volume_monitor_get_mount_for_uuid (GVolumeMonitor *_self,
+                                             const char *uuid)
 {
-    return NULL;
+  return NULL;
 }
 
-static GVolume *g_vfs_afc_volume_monitor_adopt_orphan_mount(GMount *mount,
-        GVolumeMonitor *unused)
+static GVolume *
+g_vfs_afc_volume_monitor_adopt_orphan_mount (GMount *mount,
+                                             GVolumeMonitor *unused)
 {
-    return NULL;
+  return NULL;
 }
 
-static gboolean g_vfs_afc_volume_monitor_is_supported(void)
+static gboolean
+g_vfs_afc_volume_monitor_is_supported (void)
 {
-    return TRUE;
+  return TRUE;
 }
 
-static void g_vfs_afc_volume_monitor_class_init(GVfsAfcVolumeMonitorClass *
-        klass)
+static void
+g_vfs_afc_volume_monitor_class_init (GVfsAfcVolumeMonitorClass * klass)
 {
-    GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
-    GVolumeMonitorClass *monitor_class = G_VOLUME_MONITOR_CLASS(klass);
-
-    gobject_class->constructor = g_vfs_afc_volume_monitor_constructor;
-    gobject_class->finalize = g_vfs_afc_volume_monitor_finalize;
-
-    monitor_class->get_mounts = g_vfs_afc_volume_monitor_get_mounts;
-    monitor_class->get_volumes = g_vfs_afc_volume_monitor_get_volumes;
-    monitor_class->get_connected_drives
-        = g_vfs_afc_volume_monitor_get_connected_drives;
-    monitor_class->get_volume_for_uuid
-        = g_vfs_afc_volume_monitor_get_volume_for_uuid;
-    monitor_class->get_mount_for_uuid
-        = g_vfs_afc_volume_monitor_get_mount_for_uuid;
-    monitor_class->adopt_orphan_mount
-        = g_vfs_afc_volume_monitor_adopt_orphan_mount;
-    monitor_class->is_supported = g_vfs_afc_volume_monitor_is_supported;
+  GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+  GVolumeMonitorClass *monitor_class = G_VOLUME_MONITOR_CLASS(klass);
+
+  gobject_class->constructor = g_vfs_afc_volume_monitor_constructor;
+  gobject_class->finalize = g_vfs_afc_volume_monitor_finalize;
+
+  monitor_class->get_mounts = g_vfs_afc_volume_monitor_get_mounts;
+  monitor_class->get_volumes = g_vfs_afc_volume_monitor_get_volumes;
+  monitor_class->get_connected_drives = g_vfs_afc_volume_monitor_get_connected_drives;
+  monitor_class->get_volume_for_uuid = g_vfs_afc_volume_monitor_get_volume_for_uuid;
+  monitor_class->get_mount_for_uuid = g_vfs_afc_volume_monitor_get_mount_for_uuid;
+  monitor_class->adopt_orphan_mount = g_vfs_afc_volume_monitor_adopt_orphan_mount;
+  monitor_class->is_supported = g_vfs_afc_volume_monitor_is_supported;
 }
 
-static void g_vfs_afc_volume_monitor_init(GVfsAfcVolumeMonitor *self)
+static void
+g_vfs_afc_volume_monitor_init(GVfsAfcVolumeMonitor *self)
 {
-
 }
 
-GVolumeMonitor *g_vfs_afc_volume_monitor_new(void)
+GVolumeMonitor *
+g_vfs_afc_volume_monitor_new (void)
 {
-    return G_VOLUME_MONITOR(g_object_new(G_VFS_TYPE_AFC_VOLUME_MONITOR,
-                NULL));
+  return G_VOLUME_MONITOR(g_object_new (G_VFS_TYPE_AFC_VOLUME_MONITOR,
+                                        NULL));
 }
 
 /*
diff --git a/monitor/afc/afc-volume-monitor.h b/monitor/afc/afc-volume-monitor.h
index 6862216..0bd5f32 100644
--- a/monitor/afc/afc-volume-monitor.h
+++ b/monitor/afc/afc-volume-monitor.h
@@ -13,34 +13,26 @@
 G_BEGIN_DECLS
 
 #define G_VFS_TYPE_AFC_VOLUME_MONITOR   (g_vfs_afc_volume_monitor_get_type())
-#define G_VFS_AFC_VOLUME_MONITOR(o) \
-    (G_TYPE_CHECK_INSTANCE_CAST((o), G_VFS_TYPE_AFC_VOLUME_MONITOR, \
-                                GVfsAfcVolumeMonitor))
-#define G_VFS_AFC_VOLUME_MONITOR_CLASS(k) \
-    (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_AFC_VOLUME_MONITOR, \
-                             GVfsAfcVolumeMonitorClass))
-#define G_VFS_IS_AFC_VOLUME_MONITOR(o) \
-    (G_TYPE_CHECK_INSTANCE_TYPE((o), G_VFS_TYPE_AFC_VOLUME_MONITOR))
-#define G_VFS_IS_AFC_VOLUME_MONITOR_CLASS(k) \
-    (G_TYPE_CHECK_CLASS_TYPE((k), G_VFS_TYPE_AFC_VOLUME_MONITOR))
-#define G_VFS_AFC_VOLUME_MONITOR_GET_CLASS(o) \
-    (G_TYPE_INSTANCE_GET_CLASS((o), G_VFS_TYPE_AFC_VOLUME_MONITOR, \
-                               GVfsAfcVolumeMonitorClass))
+#define G_VFS_AFC_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST((o), G_VFS_TYPE_AFC_VOLUME_MONITOR, GVfsAfcVolumeMonitor))
+#define G_VFS_AFC_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_AFC_VOLUME_MONITOR, GVfsAfcVolumeMonitorClass))
+#define G_VFS_IS_AFC_VOLUME_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), G_VFS_TYPE_AFC_VOLUME_MONITOR))
+#define G_VFS_IS_AFC_VOLUME_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), G_VFS_TYPE_AFC_VOLUME_MONITOR))
+#define G_VFS_AFC_VOLUME_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), G_VFS_TYPE_AFC_VOLUME_MONITOR, GVfsAfcVolumeMonitorClass))
 
 typedef struct _GVfsAfcVolumeMonitor GVfsAfcVolumeMonitor;
 typedef struct _GVfsAfcVolumeMonitorClass GVfsAfcVolumeMonitorClass;
 
 struct _GVfsAfcVolumeMonitorClass {
-    GVolumeMonitorClass parent_class;
+  GVolumeMonitorClass parent_class;
 };
 
-GType g_vfs_afc_volume_monitor_get_type(void) G_GNUC_CONST;
+GType g_vfs_afc_volume_monitor_get_type (void) G_GNUC_CONST;
 
-GVolumeMonitor *g_vfs_afc_volume_monitor_new(void);
+GVolumeMonitor *g_vfs_afc_volume_monitor_new (void);
 
 G_END_DECLS
 
-#endif
+#endif /* AFC_VOLUME_MONITOR_H */
 
 /*
  * vim: sw=2 ts=8 cindent expandtab cinoptions=f0,>4,n2,{2,(0,^-2,t0 ai
diff --git a/monitor/afc/afc-volume.c b/monitor/afc/afc-volume.c
index 428b3a9..b199ba0 100644
--- a/monitor/afc/afc-volume.c
+++ b/monitor/afc/afc-volume.c
@@ -18,179 +18,187 @@
 #define DEFAULT_SERVICE "com.apple.afc"
 
 struct _GVfsAfcVolume {
-    GObject parent;
+  GObject parent;
 
-    GVolumeMonitor *monitor;
+  GVolumeMonitor *monitor;
 
-    char *uuid;
-    char *udi;
+  char *uuid;
+  char *udi;
 
-    char *name;
-    char *icon;
-    char *icon_fallback;
+  char *name;
+  char *icon;
+  char *icon_fallback;
 };
 
-static void g_vfs_afc_volume_iface_init(GVolumeIface *iface);
+static void g_vfs_afc_volume_iface_init (GVolumeIface *iface);
 
 G_DEFINE_TYPE_EXTENDED(GVfsAfcVolume, g_vfs_afc_volume, G_TYPE_OBJECT, 0,
-        G_IMPLEMENT_INTERFACE(G_TYPE_VOLUME, g_vfs_afc_volume_iface_init))
+                       G_IMPLEMENT_INTERFACE(G_TYPE_VOLUME, g_vfs_afc_volume_iface_init))
 
-static void g_vfs_afc_volume_finalize(GObject *self_)
+static void
+g_vfs_afc_volume_finalize (GObject *self_)
 {
-    GVfsAfcVolume *self;
+  GVfsAfcVolume *self;
 
-    self = G_VFS_AFC_VOLUME(self);
+  self = G_VFS_AFC_VOLUME(self);
 
-    g_free (self->uuid);
-    g_free (self->udi);
+  g_free (self->uuid);
+  g_free (self->udi);
 
-    g_free (self->name);
-    g_free (self->icon);
-    g_free (self->icon_fallback);
+  g_free (self->name);
+  g_free (self->icon);
+  g_free (self->icon_fallback);
 
-    if (G_OBJECT_CLASS(g_vfs_afc_volume_parent_class)->finalize)
-        (*G_OBJECT_CLASS(g_vfs_afc_volume_parent_class)->finalize)(
-                G_OBJECT(self));
+  if (G_OBJECT_CLASS(g_vfs_afc_volume_parent_class)->finalize)
+    (*G_OBJECT_CLASS(g_vfs_afc_volume_parent_class)->finalize) (G_OBJECT(self));
 }
 
-static void g_vfs_afc_volume_init(GVfsAfcVolume *self)
+static void
+g_vfs_afc_volume_init (GVfsAfcVolume *self)
 {
-    GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (self);
+  GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (self);
 
-    afc_volume->name = g_strdup ("iPhone");
-    afc_volume->icon = g_strdup ("phone-apple-iphone");
+  afc_volume->name = g_strdup ("iPhone");
+  afc_volume->icon = g_strdup ("phone-apple-iphone");
 }
 
-static void g_vfs_afc_volume_class_init(GVfsAfcVolumeClass *klass)
+static void
+g_vfs_afc_volume_class_init (GVfsAfcVolumeClass *klass)
 {
-    GObjectClass *gobject_class;
-    gobject_class = G_OBJECT_CLASS(klass);
-    gobject_class->finalize = g_vfs_afc_volume_finalize;
+  GObjectClass *gobject_class;
+  gobject_class = G_OBJECT_CLASS(klass);
+  gobject_class->finalize = g_vfs_afc_volume_finalize;
 }
 
-static int _g_vfs_afc_volume_update_metadata(GVfsAfcVolume *self)
+static int
+_g_vfs_afc_volume_update_metadata (GVfsAfcVolume *self)
 {
-	iphone_device_t dev;
-	afc_client_t afc_cli;
-	lockdownd_client_t lockdown_cli = NULL;
-	iphone_error_t err;
-	guint retries;
-	char *model, *display_name;
-	int port;
-
-	retries = 0;
-	do {
-		err = iphone_get_device_by_uuid(&dev, self->uuid);
-		if (err == IPHONE_E_SUCCESS) {
-			break;
-		}
-		sleep (1); 
-	} while (retries++ < 10);
-
-	if (err != IPHONE_E_SUCCESS)
-		return 0;
-
-	if (lockdownd_client_new(dev, &lockdown_cli) != LOCKDOWN_E_SUCCESS) {
-		iphone_device_free(dev);
-		return 0;
-	}
-
-	/* try to use pretty device name */
-	if (lockdownd_get_device_name(lockdown_cli, &display_name) == LOCKDOWN_E_SUCCESS) {
-		g_free (self->name);
-		self->name = display_name;
-	}
-
-	if (lockdownd_start_service(lockdown_cli, DEFAULT_SERVICE, &port) != LOCKDOWN_E_SUCCESS) {
-		lockdownd_client_free(lockdown_cli);
-		iphone_device_free(dev);
-		return 0;
-	}
-
-	if (afc_client_new(dev, port, &afc_cli) == AFC_E_SUCCESS) {
-		/* set correct fd icon spec name depending on device model */
-		model = afc_get_device_info_field (afc_cli, "Model");
-		if (model != NULL) {
-			if(strstr(model, "iPod") != NULL) {
-				g_free (self->icon);
-				self->icon = g_strdup ("multimedia-player-apple-ipod-touch");
-			}
-			g_free (model);
-		}
-		afc_client_free(afc_cli);
-	}
-
-	lockdownd_client_free(lockdown_cli);
-	iphone_device_free(dev);
-	
-	return 1;
+  iphone_device_t dev;
+  afc_client_t afc_cli;
+  lockdownd_client_t lockdown_cli = NULL;
+  iphone_error_t err;
+  guint retries;
+  char *model, *display_name;
+  int port;
+
+  retries = 0;
+  do {
+      err = iphone_get_device_by_uuid (&dev, self->uuid);
+      if (err == IPHONE_E_SUCCESS)
+        break;
+      sleep (1); 
+  } while (retries++ < 10);
+
+  if (err != IPHONE_E_SUCCESS)
+    return 0;
+
+  if (lockdownd_client_new (dev, &lockdown_cli) != LOCKDOWN_E_SUCCESS)
+    {
+      iphone_device_free (dev);
+      return 0;
+    }
+
+  /* try to use pretty device name */
+  if (lockdownd_get_device_name (lockdown_cli, &display_name) == LOCKDOWN_E_SUCCESS)
+    {
+      g_free (self->name);
+      self->name = display_name;
+    }
+
+  if (lockdownd_start_service (lockdown_cli, DEFAULT_SERVICE, &port) != LOCKDOWN_E_SUCCESS)
+    {
+      lockdownd_client_free (lockdown_cli);
+      iphone_device_free (dev);
+      return 0;
+    }
+
+  if (afc_client_new (dev, port, &afc_cli) == AFC_E_SUCCESS)
+    {
+      /* set correct fd icon spec name depending on device model */
+      model = afc_get_device_info_field (afc_cli, "Model");
+      if (model != NULL)
+        {
+          if(strstr(model, "iPod") != NULL)
+            {
+              g_free (self->icon);
+              self->icon = g_strdup ("multimedia-player-apple-ipod-touch");
+            }
+          g_free (model);
+        }
+      afc_client_free(afc_cli);
+    }
+
+  lockdownd_client_free (lockdown_cli);
+  iphone_device_free (dev);
+
+  return 1;
 }
 
-GVfsAfcVolume *g_vfs_afc_volume_new(GVolumeMonitor *monitor,
-                                    const char     *udi,
-				    const char     *uuid)
+GVfsAfcVolume *
+g_vfs_afc_volume_new (GVolumeMonitor *monitor,
+                      const char     *udi,
+                      const char     *uuid)
 {
-    GVfsAfcVolume *self;
+  GVfsAfcVolume *self;
 
-    self = G_VFS_AFC_VOLUME(g_object_new(G_VFS_TYPE_AFC_VOLUME, NULL));
-    self->monitor = monitor;
-    self->uuid = g_strdup (uuid);
-    self->udi = g_strdup (udi);
+  self = G_VFS_AFC_VOLUME(g_object_new (G_VFS_TYPE_AFC_VOLUME, NULL));
+  self->monitor = monitor;
+  self->uuid = g_strdup (uuid);
+  self->udi = g_strdup (udi);
 
-    /* Get mount information here */
-    if (!_g_vfs_afc_volume_update_metadata(self)) {
-        return NULL;
-    };
+  /* Get mount information here */
+  if (!_g_vfs_afc_volume_update_metadata (self))
+      return NULL;
 
-    return self;
+  return self;
 }
 
 static char *
 g_vfs_afc_volume_get_name (GVolume *volume)
 {
-    GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (volume);
-    char *name;
+  GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (volume);
+  char *name;
 
-    name = g_strdup (afc_volume->name);
+  name = g_strdup (afc_volume->name);
 
-    return name;
+  return name;
 }
 
 static GIcon *
 g_vfs_afc_volume_get_icon (GVolume *volume)
 {
-    GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (volume);
-    GIcon *icon;
+  GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (volume);
+  GIcon *icon;
 
-    icon = g_themed_icon_new_with_default_fallbacks (afc_volume->icon);
+  icon = g_themed_icon_new_with_default_fallbacks (afc_volume->icon);
 
-    return icon;
+  return icon;
 }
 
 static char *
 g_vfs_afc_volume_get_uuid (GVolume *volume)
 {
-    GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (volume);
+  GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (volume);
 
-    return g_strdup (afc_volume->uuid);
+  return g_strdup (afc_volume->uuid);
 }
 
 static gboolean
 g_vfs_afc_volume_can_mount (GVolume *volume)
 {
-    return TRUE;
+  return TRUE;
 }
 
 static gboolean
 g_vfs_afc_volume_can_eject (GVolume *volume)
 {
-    return FALSE;
+  return FALSE;
 }
 
 static gboolean
 g_vfs_afc_volume_should_automount (GVolume *volume)
 {
-    return TRUE;
+  return TRUE;
 }
 
 static GDrive *
@@ -216,8 +224,8 @@ typedef struct
 
 static void
 mount_callback (GObject *source_object,
-                        GAsyncResult *res,
-                        gpointer user_data)
+                GAsyncResult *res,
+                gpointer user_data)
 {
   ActivationMountOp *data = user_data;
   data->callback (G_OBJECT (data->enclosing_volume), res, data->user_data);
@@ -239,8 +247,8 @@ g_vfs_afc_volume_mount (GVolume             *volume,
   char *uri;
 
   g_print ("g_vfs_afc_volume_mount (can_mount=%d uuid=%s)\n",
-              g_vfs_afc_volume_can_mount (volume),
-              afc_volume->uuid);
+           g_vfs_afc_volume_can_mount (volume),
+           afc_volume->uuid);
 
   uri = g_strdup_printf ("afc://%s", afc_volume->uuid);
   root = g_file_new_for_uri (uri);
@@ -264,8 +272,8 @@ g_vfs_afc_volume_mount (GVolume             *volume,
 
 static gboolean
 g_vfs_afc_volume_mount_finish (GVolume       *volume,
-			       GAsyncResult  *result,
-			       GError       **error)
+                               GAsyncResult  *result,
+                               GError       **error)
 {
   GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (volume);
   GFile *root;
@@ -279,7 +287,7 @@ g_vfs_afc_volume_mount_finish (GVolume       *volume,
 
 static char *
 g_vfs_afc_volume_get_identifier (GVolume              *volume,
-                             const char          *kind)
+                                 const char          *kind)
 {
   GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (volume);
   char *id;
@@ -305,8 +313,10 @@ g_vfs_afc_volume_enumerate_identifiers (GVolume *volume)
                    g_strdup (G_VOLUME_IDENTIFIER_KIND_HAL_UDI));
 
   if (afc_volume->uuid && *afc_volume->uuid != 0)
-    g_ptr_array_add (res,
-                     g_strdup (G_VOLUME_IDENTIFIER_KIND_UUID));
+    {
+        g_ptr_array_add (res,
+                         g_strdup (G_VOLUME_IDENTIFIER_KIND_UUID));
+    }
 
   /* Null-terminate */
   g_ptr_array_add (res, NULL);
@@ -317,40 +327,40 @@ g_vfs_afc_volume_enumerate_identifiers (GVolume *volume)
 static GFile *
 g_vfs_afc_volume_get_activation_root (GVolume *volume)
 {
-    GFile *root = g_object_get_data (G_OBJECT (volume), "root");
+  GFile *root = g_object_get_data (G_OBJECT (volume), "root");
 
-    return g_object_ref (root);
+  return g_object_ref (root);
 }
 
 static void
 g_vfs_afc_volume_iface_init (GVolumeIface *iface)
 {
-    iface->get_name = g_vfs_afc_volume_get_name;
-    iface->get_icon = g_vfs_afc_volume_get_icon;
-    iface->get_uuid = g_vfs_afc_volume_get_uuid;
-    iface->get_drive = g_vfs_afc_volume_get_drive;
-    iface->get_mount = g_vfs_afc_volume_get_mount;
-    iface->can_mount = g_vfs_afc_volume_can_mount;
-    iface->can_eject = g_vfs_afc_volume_can_eject;
-    iface->should_automount = g_vfs_afc_volume_should_automount;
-    iface->mount_fn = g_vfs_afc_volume_mount;
-    iface->mount_finish = g_vfs_afc_volume_mount_finish;
-    iface->eject = NULL;
-    iface->eject_finish = NULL;
-    iface->get_identifier = g_vfs_afc_volume_get_identifier;
-    iface->enumerate_identifiers = g_vfs_afc_volume_enumerate_identifiers;
-    iface->get_activation_root = g_vfs_afc_volume_get_activation_root;
+  iface->get_name = g_vfs_afc_volume_get_name;
+  iface->get_icon = g_vfs_afc_volume_get_icon;
+  iface->get_uuid = g_vfs_afc_volume_get_uuid;
+  iface->get_drive = g_vfs_afc_volume_get_drive;
+  iface->get_mount = g_vfs_afc_volume_get_mount;
+  iface->can_mount = g_vfs_afc_volume_can_mount;
+  iface->can_eject = g_vfs_afc_volume_can_eject;
+  iface->should_automount = g_vfs_afc_volume_should_automount;
+  iface->mount_fn = g_vfs_afc_volume_mount;
+  iface->mount_finish = g_vfs_afc_volume_mount_finish;
+  iface->eject = NULL;
+  iface->eject_finish = NULL;
+  iface->get_identifier = g_vfs_afc_volume_get_identifier;
+  iface->enumerate_identifiers = g_vfs_afc_volume_enumerate_identifiers;
+  iface->get_activation_root = g_vfs_afc_volume_get_activation_root;
 }
 
 char *g_vfs_afc_volume_get_udi(GVfsAfcVolume *volume)
 {
-    return volume->udi;
+  return volume->udi;
 }
 
 gboolean g_vfs_afc_volume_has_uuid(GVfsAfcVolume *volume, const char *uuid)
 {
-    char *voluuid = g_vfs_afc_volume_get_uuid(G_VOLUME(volume));
-    return (g_strcmp0(voluuid, uuid) == 0);
+  GVfsAfcVolume *afc_volume = G_VFS_AFC_VOLUME (volume);
+  return (g_strcmp0 (afc_volume->uuid, uuid) == 0);
 }
 
 /*
diff --git a/monitor/afc/afc-volume.h b/monitor/afc/afc-volume.h
index 175e051..0ec651a 100644
--- a/monitor/afc/afc-volume.h
+++ b/monitor/afc/afc-volume.h
@@ -15,36 +15,31 @@
 G_BEGIN_DECLS
 
 #define G_VFS_TYPE_AFC_VOLUME   (g_vfs_afc_volume_get_type())
-#define G_VFS_AFC_VOLUME(o) \
-    (G_TYPE_CHECK_INSTANCE_CAST((o), G_VFS_TYPE_AFC_VOLUME, GVfsAfcVolume))
-#define G_VFS_AFC_VOLUME_CLASS(k) \
-    (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_AFC_VOLUME, GVfsAfcVolumeClass))
-#define G_VFS_IS_AFC_VOLUME(o) \
-    (G_TYPE_CHECK_INSTANCE_TYPE((o), G_VFS_TYPE_AFC_VOLUME))
-#define G_VFS_IS_AFC_VOLUME_CLASS(k) \
-    ((G_TYPE_CHECK_CLASS_TYPE((k), G_VFS_TYPE_AFC_VOLUME))
-#define G_VFS_AFC_VOLUME_GET_CLASS(o) \
-    (G_TYPE_INSTANCE_GET_CLASS((o), G_VFS_TYPE_AFC_VOLUME, GVfsAfcVolumeClass))
+#define G_VFS_AFC_VOLUME(o) (G_TYPE_CHECK_INSTANCE_CAST((o), G_VFS_TYPE_AFC_VOLUME, GVfsAfcVolume))
+#define G_VFS_AFC_VOLUME_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_AFC_VOLUME, GVfsAfcVolumeClass))
+#define G_VFS_IS_AFC_VOLUME(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), G_VFS_TYPE_AFC_VOLUME))
+#define G_VFS_IS_AFC_VOLUME_CLASS(k) ((G_TYPE_CHECK_CLASS_TYPE((k), G_VFS_TYPE_AFC_VOLUME))
+#define G_VFS_AFC_VOLUME_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), G_VFS_TYPE_AFC_VOLUME, GVfsAfcVolumeClass))
 
 typedef struct _GVfsAfcVolume GVfsAfcVolume;
 typedef struct _GVfsAfcVolumeClass GVfsAfcVolumeClass;
 
 struct _GVfsAfcVolumeClass {
-    GObjectClass parent_class;
+  GObjectClass parent_class;
 };
 
-GType g_vfs_afc_volume_get_type(void) G_GNUC_CONST;
+GType g_vfs_afc_volume_get_type (void) G_GNUC_CONST;
 
-GVfsAfcVolume *g_vfs_afc_volume_new(GVolumeMonitor *monitor,
-                                    const char     *udi,
-				    const char     *uuid);
+GVfsAfcVolume *g_vfs_afc_volume_new (GVolumeMonitor *monitor,
+                                     const char     *udi,
+                                     const char     *uuid);
 
-char *g_vfs_afc_volume_get_udi(GVfsAfcVolume *volume);
-gboolean g_vfs_afc_volume_has_uuid(GVfsAfcVolume *volume, const char *uuid);
+char *g_vfs_afc_volume_get_udi (GVfsAfcVolume *volume);
+gboolean g_vfs_afc_volume_has_uuid (GVfsAfcVolume *volume, const char *uuid);
 
 G_END_DECLS
 
-#endif
+#endif /* GVFS_MONITOR_AFC_AFC_VOLUME_H */
 
 /*
  * vim: sw=2 ts=8 cindent expandtab cinoptions=f0,>4,n2,{2,(0,^-2,t0 ai
-- 
1.6.2.5


--=-7mDiggiHRcr1i+Mtu2TL--



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