diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2010-11-27 00:05:02 +0000 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-04-18 08:57:31 +0200 |
commit | b98cfe87b1f5a026abf184ca2452214e7a869c20 (patch) | |
tree | acc555b59d6a826a9d0a0f449d17b338babd4fd2 /telepathy-glib/debug-client.c | |
parent | e8bb33b6c8213d82562d4b8436a2a4de0ffde172 (diff) | |
download | telepathy-glib-b98cfe87b1f5a026abf184ca2452214e7a869c20.tar.gz |
DebugClient: add set_enabled_async()
This is the only binding I'm going to bother adding for now.
Diffstat (limited to 'telepathy-glib/debug-client.c')
-rw-r--r-- | telepathy-glib/debug-client.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/telepathy-glib/debug-client.c b/telepathy-glib/debug-client.c index 0789f0fb4..45ef9350e 100644 --- a/telepathy-glib/debug-client.c +++ b/telepathy-glib/debug-client.c @@ -28,6 +28,7 @@ #define DEBUG_FLAG TP_DEBUG_DEBUGGER #include "telepathy-glib/debug-internal.h" #include "telepathy-glib/proxy-internal.h" +#include "telepathy-glib/util-internal.h" #include "telepathy-glib/_gen/tp-cli-debug-body.h" @@ -281,3 +282,45 @@ tp_debug_client_new ( "object-path", TP_DEBUG_OBJECT_PATH, NULL)); } + +static void +set_enabled_cb ( + TpProxy *proxy, + const GError *error, + gpointer user_data, + GObject *weak_object) +{ + GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data); + + if (error != NULL) + g_simple_async_result_set_from_error (result, error); + + g_simple_async_result_complete (result); +} + +void +tp_debug_client_set_enabled_async ( + TpDebugClient *self, + gboolean enabled, + GAsyncReadyCallback callback, + gpointer user_data) +{ + GSimpleAsyncResult *result = g_simple_async_result_new (G_OBJECT (self), + callback, user_data, tp_debug_client_set_enabled_async); + GValue v = { 0, }; + + g_value_init (&v, G_TYPE_BOOLEAN); + g_value_set_boolean (&v, enabled); + tp_cli_dbus_properties_call_set (self, -1, TP_IFACE_DEBUG, "Enabled", &v, + set_enabled_cb, result, g_object_unref, NULL); + g_value_unset (&v); +} + +gboolean +tp_debug_client_set_enabled_finish ( + TpDebugClient *self, + GAsyncResult *result, + GError **error) +{ + _tp_implement_finish_void (self, tp_debug_client_set_enabled_async) +} |