[Telepathy-commits] [telepathy-gabble/master] GabbleRosterChannel: use less strange API to hook up D-Bus properties

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Aug 19 10:53:03 PDT 2008


20080527121931-53eee-1e36d3cb6322693e4dd4f84144d381e887a03b44.gz
---
 src/gabble-roster-channel.c |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/src/gabble-roster-channel.c b/src/gabble-roster-channel.c
index 24defc7..36e2da0 100644
--- a/src/gabble-roster-channel.c
+++ b/src/gabble-roster-channel.c
@@ -260,10 +260,7 @@ gabble_roster_channel_class_init (GabbleRosterChannelClass *gabble_roster_channe
 {
   GObjectClass *object_class = G_OBJECT_CLASS (gabble_roster_channel_class);
   GParamSpec *param_spec;
-  static TpDBusPropertiesMixinIfaceImpl interfaces[] = {
-        { NULL /* initialized with tp_group_mixin_init_dbus_properties () */ },
-        { NULL }
-  };
+  static gboolean initialized = FALSE;
 
   g_type_class_add_private (gabble_roster_channel_class,
       sizeof (GabbleRosterChannelPrivate));
@@ -294,19 +291,19 @@ gabble_roster_channel_class_init (GabbleRosterChannelClass *gabble_roster_channe
       "handle-type");
   g_object_class_override_property (object_class, PROP_HANDLE, "handle");
 
-  tp_group_mixin_class_init (object_class,
-      G_STRUCT_OFFSET (GabbleRosterChannelClass, group_class),
-      _gabble_roster_channel_add_member_cb,
-      _gabble_roster_channel_remove_member_cb);
-
-  gabble_roster_channel_class->properties_class.interfaces = interfaces;
-
-  /* only executed once */
-  if (interfaces[0].name == NULL)
-    tp_group_mixin_init_dbus_properties (&(interfaces[0]));
-
   tp_dbus_properties_mixin_class_init (object_class,
       G_STRUCT_OFFSET (GabbleRosterChannelClass, properties_class));
+
+  if (!initialized)
+    {
+      initialized = TRUE;
+
+      tp_group_mixin_class_init (object_class,
+          G_STRUCT_OFFSET (GabbleRosterChannelClass, group_class),
+          _gabble_roster_channel_add_member_cb,
+          _gabble_roster_channel_remove_member_cb);
+      tp_group_mixin_init_dbus_properties (object_class);
+    }
 }
 
 void
-- 
1.5.6.3




More information about the Telepathy-commits mailing list