diff options
author | Tomas Bzatek <tbzatek@redhat.com> | 2012-07-31 11:58:09 +0200 |
---|---|---|
committer | Tomas Bzatek <tbzatek@redhat.com> | 2012-07-31 11:58:09 +0200 |
commit | 622a5c0d167556188c38fcde40a42a0dfad9c625 (patch) | |
tree | 04f27be7f2a54779e17029ede2554e39c3464aa0 /daemon/gvfsjobmakedirectory.c | |
parent | a494b809eaf82994108bfbbe5d950fed1a0a8c7c (diff) | |
download | gvfs-622a5c0d167556188c38fcde40a42a0dfad9c625.tar.gz |
gdbus: Core daemon and client port
Port of most of the gvfs core, few bits still missing. Lot of debug prints around,
will be removed in further commits. Same amount of TODOs and FIXMEs.
Notes:
* kill serials?
* get rid of mainloops where applicable (copy/move progress callback, enumerator)
* fix keyring integration
* use gdbus builtin fd passing within gvfsdaemon.c, kill the extra_fd stuff
Diffstat (limited to 'daemon/gvfsjobmakedirectory.c')
-rw-r--r-- | daemon/gvfsjobmakedirectory.c | 67 |
1 files changed, 25 insertions, 42 deletions
diff --git a/daemon/gvfsjobmakedirectory.c b/daemon/gvfsjobmakedirectory.c index 5422393e..c26430e2 100644 --- a/daemon/gvfsjobmakedirectory.c +++ b/daemon/gvfsjobmakedirectory.c @@ -28,19 +28,17 @@ #include <sys/un.h> #include <glib.h> -#include <dbus/dbus.h> #include <glib/gi18n.h> #include "gvfsjobmakedirectory.h" -#include "gvfsdbusutils.h" #include "gvfsdaemonprotocol.h" G_DEFINE_TYPE (GVfsJobMakeDirectory, g_vfs_job_make_directory, G_VFS_TYPE_JOB_DBUS) static void run (GVfsJob *job); static gboolean try (GVfsJob *job); -static DBusMessage *create_reply (GVfsJob *job, - DBusConnection *connection, - DBusMessage *message); +static void create_reply (GVfsJob *job, + GVfsDBusMount *object, + GDBusMethodInvocation *invocation); static void g_vfs_job_make_directory_finalize (GObject *object) @@ -73,42 +71,31 @@ g_vfs_job_make_directory_init (GVfsJobMakeDirectory *job) { } -GVfsJob * -g_vfs_job_make_directory_new (DBusConnection *connection, - DBusMessage *message, - GVfsBackend *backend) +gboolean +g_vfs_job_make_directory_new_handle (GVfsDBusMount *object, + GDBusMethodInvocation *invocation, + const gchar *arg_path_data, + GVfsBackend *backend) { GVfsJobMakeDirectory *job; - DBusMessage *reply; - DBusError derror; - int path_len; - const char *path_data; - - dbus_error_init (&derror); - if (!dbus_message_get_args (message, &derror, - DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, - &path_data, &path_len, - 0)) - { - reply = dbus_message_new_error (message, - derror.name, - derror.message); - dbus_error_free (&derror); - - dbus_connection_send (connection, reply, NULL); - dbus_message_unref (reply); - return NULL; - } + g_print ("called MakeDirectory()\n"); + + if (g_vfs_backend_invocation_first_handler (object, invocation, backend)) + return TRUE; + job = g_object_new (G_VFS_TYPE_JOB_MAKE_DIRECTORY, - "message", message, - "connection", connection, - NULL); + "object", object, + "invocation", invocation, + NULL); - job->filename = g_strndup (path_data, path_len); + job->filename = g_strdup (arg_path_data); job->backend = backend; - return G_VFS_JOB (job); + g_vfs_job_source_new_job (G_VFS_JOB_SOURCE (backend), G_VFS_JOB (job)); + g_object_unref (job); + + return TRUE; } static void @@ -144,14 +131,10 @@ try (GVfsJob *job) } /* Might be called on an i/o thread */ -static DBusMessage * +static void create_reply (GVfsJob *job, - DBusConnection *connection, - DBusMessage *message) + GVfsDBusMount *object, + GDBusMethodInvocation *invocation) { - DBusMessage *reply; - - reply = dbus_message_new_method_return (message); - - return reply; + gvfs_dbus_mount_complete_make_directory (object, invocation); } |