[Telepathy-commits] [telepathy-gabble/master] GabbleRosterChannel: expose interfaces as a GObject property
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Aug 19 10:53:05 PDT 2008
20080606100207-53eee-0c7d0cd74be111bb23d765a4ea9322ca7f8a5570.gz
---
src/gabble-roster-channel.c | 21 ++++++++++++++++++---
1 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/gabble-roster-channel.c b/src/gabble-roster-channel.c
index 3bc9df7..45bbba9 100644
--- a/src/gabble-roster-channel.c
+++ b/src/gabble-roster-channel.c
@@ -50,6 +50,11 @@ G_DEFINE_TYPE_WITH_CODE (GabbleRosterChannel, gabble_roster_channel,
tp_dbus_properties_mixin_iface_init);
G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL));
+static const gchar *gabble_roster_channel_interfaces[] = {
+ TP_IFACE_CHANNEL_INTERFACE_GROUP,
+ NULL
+};
+
/* properties */
enum
{
@@ -58,6 +63,7 @@ enum
PROP_HANDLE_TYPE,
PROP_HANDLE,
PROP_CONNECTION,
+ PROP_INTERFACES,
LAST_PROPERTY
};
@@ -208,6 +214,9 @@ gabble_roster_channel_get_property (GObject *object,
case PROP_CONNECTION:
g_value_set_object (value, priv->conn);
break;
+ case PROP_INTERFACES:
+ g_value_set_boxed (value, gabble_roster_channel_interfaces);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -282,6 +291,13 @@ gabble_roster_channel_class_init (GabbleRosterChannelClass *gabble_roster_channe
G_PARAM_STATIC_BLURB);
g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
+ param_spec = g_param_spec_boxed ("interfaces", "Extra D-Bus interfaces",
+ "Additional Channel.Interface.* interfaces",
+ G_TYPE_STRV,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_STATIC_NAME);
+ g_object_class_install_property (object_class, PROP_INTERFACES, param_spec);
+
g_object_class_override_property (object_class, PROP_OBJECT_PATH,
"object-path");
g_object_class_override_property (object_class, PROP_CHANNEL_TYPE,
@@ -636,9 +652,8 @@ static void
gabble_roster_channel_get_interfaces (TpSvcChannel *self,
DBusGMethodInvocation *context)
{
- const char *interfaces[] = { TP_IFACE_CHANNEL_INTERFACE_GROUP, NULL };
-
- tp_svc_channel_return_from_get_interfaces (context, interfaces);
+ tp_svc_channel_return_from_get_interfaces (context,
+ gabble_roster_channel_interfaces);
}
--
1.5.6.3
More information about the Telepathy-commits
mailing list