summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2009-11-20 07:48:25 (GMT)
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2009-11-20 07:48:25 (GMT)
commitec39a8308b62ec429ea3a1df4fc09d3695f11083 (patch)
tree4fcb02250cc9db3221eea639da8bf4e43e8665bc
parenta8642314b292d01a83857ef2cfc90572c91dbd9d (diff)
downloadtelepathy-doc-ec39a8308b62ec429ea3a1df4fc09d3695f11083.tar.gz
telepathy-doc-ec39a8308b62ec429ea3a1df4fc09d3695f11083.tar.xz
Implement HandleChannels
-rw-r--r--docs/examples/glib_mc5_dbus_tube_handler/example-handler.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/docs/examples/glib_mc5_dbus_tube_handler/example-handler.c b/docs/examples/glib_mc5_dbus_tube_handler/example-handler.c
index 2ad0ef1..cb5ad1e 100644
--- a/docs/examples/glib_mc5_dbus_tube_handler/example-handler.c
+++ b/docs/examples/glib_mc5_dbus_tube_handler/example-handler.c
@@ -41,6 +41,8 @@ enum
typedef struct _ExampleHandlerPrivate ExampleHandlerPrivate;
struct _ExampleHandlerPrivate
{
+ GList *channels;
+
TpTubeState state;
char *address;
};
@@ -122,6 +124,7 @@ tube_channel_ready (TpChannel *channel,
gpointer user_data)
{
ExampleHandler *self = EXAMPLE_HANDLER (user_data);
+ ExampleHandlerPrivate *priv = GET_PRIVATE (self);
if (in_error != NULL)
{
@@ -132,6 +135,9 @@ tube_channel_ready (TpChannel *channel,
g_print ("Channel ready\n");
+ /* add the channel to the list */
+ priv->channels = g_list_prepend (priv->channels, channel);
+
tp_cli_channel_interface_tube_connect_to_tube_channel_state_changed (
channel, tube_state_changed_callback,
NULL, NULL, G_OBJECT (self), &error);
@@ -215,10 +221,12 @@ example_handler_handle_channels (TpSvcClientHandler *self,
static void
example_handler_get_property (GObject *self,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
+ ExampleHandlerPrivate *priv = GET_PRIVATE (self);
+
switch (property_id)
{
case PROP_INTERFACES:
@@ -257,6 +265,14 @@ example_handler_get_property (GObject *self,
{
GPtrArray *array = g_ptr_array_new ();
+ GList *ptr;
+
+ for (ptr = priv->channels; ptr; ptr = ptr->next)
+ {
+ g_ptr_array_add (array,
+ g_strdup (tp_proxy_get_object_path (TP_PROXY (ptr->data))));
+ }
+
g_value_take_boxed (value, array);
}