summaryrefslogtreecommitdiff
path: root/common/gmountoperationdbus.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@src.gnome.org>2007-09-13 11:36:39 +0000
committerAlexander Larsson <alexl@src.gnome.org>2007-09-13 11:36:39 +0000
commit9fe4dd51c2dd85a73459e7d51e524d017a25280f (patch)
tree2dea4aa6a0345d1a93dfe3ea372505ea471ddeb7 /common/gmountoperationdbus.c
parent251a45241a878f2e8bcb9ecebf472291a95d76c4 (diff)
downloadgvfs-9fe4dd51c2dd85a73459e7d51e524d017a25280f.tar.gz
Move mounting into a GVfsJob
Original git commit by Alexander Larsson <alex@greebo.(none)> at 1171041742 +0100 svn path=/trunk/; revision=315
Diffstat (limited to 'common/gmountoperationdbus.c')
-rw-r--r--common/gmountoperationdbus.c49
1 files changed, 15 insertions, 34 deletions
diff --git a/common/gmountoperationdbus.c b/common/gmountoperationdbus.c
index 846a8da6..b75ec4ec 100644
--- a/common/gmountoperationdbus.c
+++ b/common/gmountoperationdbus.c
@@ -3,6 +3,7 @@
#include <string.h>
#include <gio/gvfstypes.h>
+#include <gio/gvfserror.h>
#include "gmountoperationdbus.h"
#include "gvfsdaemonprotocol.h"
#include "gdbusutils.h"
@@ -336,14 +337,11 @@ mount_op_done (GMountOperationDBus *op,
{
const char *domain, *error_message;
dbus_bool_t success;
- DBusMessage *reply;
DBusMessageIter iter;
DBusError derror;
guint32 code;
GError *error;
- reply = NULL;
-
dbus_message_iter_init (message, &iter);
dbus_error_init (&derror);
@@ -352,51 +350,34 @@ mount_op_done (GMountOperationDBus *op,
DBUS_TYPE_BOOLEAN, &success,
0))
{
- reply = dbus_message_new_error (message, derror.name, derror.message);
- if (reply == NULL)
- _g_dbus_oom ();
- if (!dbus_connection_send (op->connection, reply, NULL))
- _g_dbus_oom ();
- dbus_message_unref (reply);
+ g_warning ("Can't get mountDone args: %s\n", derror.message);
+ dbus_error_free (&derror);
return;
}
error = NULL;
if (!success)
{
- if (!_g_dbus_message_iter_get_args (&iter,
- &derror,
- DBUS_TYPE_STRING, &domain,
- DBUS_TYPE_UINT32, &code,
- DBUS_TYPE_STRING, &error_message,
- 0))
+ if (_g_dbus_message_iter_get_args (&iter,
+ &derror,
+ DBUS_TYPE_STRING, &domain,
+ DBUS_TYPE_UINT32, &code,
+ DBUS_TYPE_STRING, &error_message,
+ 0))
+ error = g_error_new_literal (g_quark_from_string (domain),
+ code, error_message);
+ else
{
- reply = dbus_message_new_error (message, derror.name, derror.message);
- if (reply == NULL)
- _g_dbus_oom ();
- if (!dbus_connection_send (op->connection, reply, NULL))
- _g_dbus_oom ();
- dbus_message_unref (reply);
- return;
+ g_set_error (&error, G_VFS_ERROR, G_VFS_ERROR_INTERNAL_ERROR,
+ "Can't parse mount error: %s", derror.message);
+ dbus_error_free (&derror);
}
-
- error = g_error_new_literal (g_quark_from_string (domain),
- code, error_message);
}
-
g_signal_emit_by_name (op, "done", success, error);
if (error)
g_error_free (error);
-
- reply = dbus_message_new_method_return (message);
- if (reply == NULL)
- _g_dbus_oom ();
-
- if (!dbus_connection_send (op->connection, reply, NULL))
- _g_dbus_oom ();
- dbus_message_unref (reply);
}
struct FailData {