summaryrefslogtreecommitdiff
path: root/daemon/gvfsjobopeniconforread.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@redhat.com>2012-04-16 17:33:26 +0200
committerTomas Bzatek <tbzatek@redhat.com>2012-07-31 11:58:21 +0200
commit844e47f33da18ee8246c09adc70194cdb183d277 (patch)
treeaae4bcb7da22d3367f13c507014c7c1061a29ab4 /daemon/gvfsjobopeniconforread.c
parent55f336c94f9a365e8dda4acae876073eb3ef3a2f (diff)
gdbus: Port the OpenIconForRead operation
Diffstat (limited to 'daemon/gvfsjobopeniconforread.c')
-rw-r--r--daemon/gvfsjobopeniconforread.c55
1 files changed, 22 insertions, 33 deletions
diff --git a/daemon/gvfsjobopeniconforread.c b/daemon/gvfsjobopeniconforread.c
index a6a3d57d..603ffc7c 100644
--- a/daemon/gvfsjobopeniconforread.c
+++ b/daemon/gvfsjobopeniconforread.c
@@ -28,12 +28,10 @@
#include <sys/un.h>
#include <glib.h>
-#include <dbus/dbus.h>
#include <glib/gi18n.h>
+#include <gio/gunixfdlist.h>
#include "gvfsreadchannel.h"
#include "gvfsjobopeniconforread.h"
-#include "gvfsdbusutils.h"
-#include "gvfsdaemonutils.h"
G_DEFINE_TYPE (GVfsJobOpenIconForRead, g_vfs_job_open_icon_for_read, G_VFS_TYPE_JOB_OPEN_FOR_READ)
@@ -63,45 +61,36 @@ g_vfs_job_open_icon_for_read_init (GVfsJobOpenIconForRead *job)
{
}
-GVfsJob *
-g_vfs_job_open_icon_for_read_new (DBusConnection *connection,
- DBusMessage *message,
- GVfsBackend *backend)
+gboolean
+g_vfs_job_open_icon_for_read_new_handle (GVfsDBusMount *object,
+ GDBusMethodInvocation *invocation,
+ GUnixFDList *fd_list,
+ const gchar *arg_path_data,
+ GVfsBackend *backend)
{
GVfsJobOpenIconForRead *job;
GVfsJobOpenForRead *job_open_for_read;
- 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 OpenIconForRead()\n");
+ if (g_vfs_backend_invocation_first_handler (object, invocation, backend))
+ return TRUE;
+
job = g_object_new (G_VFS_TYPE_JOB_OPEN_ICON_FOR_READ,
- "message", message,
- "connection", connection,
- NULL);
-
+ "object", object,
+ "invocation", invocation,
+ NULL);
+
job_open_for_read = G_VFS_JOB_OPEN_FOR_READ (job);
- job->icon_id = g_strndup (path_data, path_len);
+ job->icon_id = g_strdup (arg_path_data);
job_open_for_read->backend = backend;
+ job_open_for_read->read_icon = TRUE;
+
+ g_vfs_job_source_new_job (G_VFS_JOB_SOURCE (backend), G_VFS_JOB (job));
+ g_object_unref (job);
- return G_VFS_JOB (job);
+ return TRUE;
}
static void