[Telepathy-commits] [telepathy-haze/master] Add DBusPropertiesMixin to contact list channels.

Will Thompson will.thompson at collabora.co.uk
Mon Aug 18 08:22:49 PDT 2008


---
 src/contact-list-channel.c |   14 +++++++++++++-
 src/contact-list-channel.h |    2 ++
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/contact-list-channel.c b/src/contact-list-channel.c
index 2f7ac3f..3a038b5 100644
--- a/src/contact-list-channel.c
+++ b/src/contact-list-channel.c
@@ -21,6 +21,7 @@
 #include <telepathy-glib/dbus.h>
 #include <telepathy-glib/interfaces.h>
 #include <telepathy-glib/channel-iface.h>
+#include <telepathy-glib/svc-generic.h>
 
 #include "contact-list-channel.h"
 #include "connection.h"
@@ -94,7 +95,9 @@ G_DEFINE_TYPE_WITH_CODE (HazeContactListChannel,
     G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_TYPE_CONTACT_LIST, NULL);
     G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL_INTERFACE_GROUP,
-      tp_group_mixin_iface_init);
+        tp_group_mixin_iface_init);
+    G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES,
+        tp_dbus_properties_mixin_iface_init);
     )
 
 /* properties: */
@@ -668,12 +671,21 @@ haze_contact_list_channel_class_init (HazeContactListChannelClass *klass)
 {
     GObjectClass *object_class = G_OBJECT_CLASS (klass);
     GParamSpec *param_spec;
+    static gboolean properties_mixin_initialized = FALSE;
 
     tp_group_mixin_class_init (object_class,
         G_STRUCT_OFFSET (HazeContactListChannelClass, group_class),
         _haze_contact_list_channel_add_member_cb,
         _haze_contact_list_channel_remove_member_cb);
 
+    if (!properties_mixin_initialized)
+    {
+        properties_mixin_initialized = TRUE;
+        klass->properties_class.interfaces = NULL;
+        tp_dbus_properties_mixin_class_init (object_class,
+            G_STRUCT_OFFSET (HazeContactListChannelClass, properties_class));
+    }
+
     object_class->constructor = haze_contact_list_channel_constructor;
 
     object_class->dispose = haze_contact_list_channel_dispose;
diff --git a/src/contact-list-channel.h b/src/contact-list-channel.h
index 86eed38..ece17c5 100644
--- a/src/contact-list-channel.h
+++ b/src/contact-list-channel.h
@@ -23,6 +23,7 @@
 #include <glib-object.h>
 
 #include <telepathy-glib/group-mixin.h>
+#include <telepathy-glib/dbus-properties-mixin.h>
 
 #include <libpurple/account.h>
 
@@ -34,6 +35,7 @@ typedef struct _HazeContactListChannelClass HazeContactListChannelClass;
 struct _HazeContactListChannelClass {
     GObjectClass parent_class;
     TpGroupMixinClass group_class;
+    TpDBusPropertiesMixinClass properties_class;
 };
 
 struct _HazeContactListChannel {
-- 
1.5.6.3




More information about the Telepathy-commits mailing list