[empathy/mc5: 89/483] Implement HandledChannels D-Bus property
- From: Sjoerd Simons <sjoerds src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy/mc5: 89/483] Implement HandledChannels D-Bus property
- Date: Fri, 21 Aug 2009 17:10:36 +0000 (UTC)
commit 41ad88801dbd0efbfe82bd5c5ba3cb595c9151ab
Author: Sjoerd Simons <sjoerd simons collabora co uk>
Date: Fri Jul 10 16:07:10 2009 +0100
Implement HandledChannels D-Bus property
libempathy/empathy-dispatcher.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-dispatcher.c b/libempathy/empathy-dispatcher.c
index 721d398..55fa668 100644
--- a/libempathy/empathy-dispatcher.c
+++ b/libempathy/empathy-dispatcher.c
@@ -90,6 +90,7 @@ enum
{
PROP_INTERFACES = 1,
PROP_CHANNEL_FILTER,
+ PROP_CHANNELS
};
enum
@@ -928,6 +929,9 @@ dispatcher_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
+ EmpathyDispatcher *dispatcher = EMPATHY_DISPATCHER (object);
+ EmpathyDispatcherPriv *priv = GET_PRIV (dispatcher);
+
switch (property_id)
{
case PROP_INTERFACES:
@@ -943,6 +947,24 @@ dispatcher_get_property (GObject *object,
g_value_set_boxed (value, filters);
break;
}
+ case PROP_CHANNELS:
+ {
+ GPtrArray *accounts;
+ GList *l;
+
+ accounts = g_ptr_array_new ();
+
+ for (l = priv->channels; l != NULL; l = g_list_next (l))
+ {
+ TpProxy *channel = TP_PROXY (l->data);
+
+ g_ptr_array_add (accounts,
+ g_strdup (tp_proxy_get_object_path (channel)));
+ }
+
+ g_value_set_boxed (value, accounts);
+ break;
+ }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -961,6 +983,7 @@ empathy_dispatcher_class_init (EmpathyDispatcherClass *klass)
};
static TpDBusPropertiesMixinPropImpl client_handler_props[] = {
{ "HandlerChannelFilter", "channel-filter", NULL },
+ { "HandledChannels", "channels", NULL },
{ NULL }
};
static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
@@ -995,6 +1018,13 @@ empathy_dispatcher_class_init (EmpathyDispatcherClass *klass)
g_object_class_install_property (object_class,
PROP_CHANNEL_FILTER, param_spec);
+ param_spec = g_param_spec_boxed ("channels", "channels",
+ "List of channels we're handling",
+ EMPATHY_ARRAY_TYPE_OBJECT,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class,
+ PROP_CHANNELS, param_spec);
+
signals[OBSERVE] =
g_signal_new ("observe",
G_TYPE_FROM_CLASS (klass),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]