[Telepathy-commits] [telepathy-gabble/master] GabbleMUCChannel: use less strange API to hook up D-Bus properties
Simon McVittie
simon.mcvittie at collabora.co.uk
Tue Aug 19 10:53:01 PDT 2008
20080527121916-53eee-01c45417fa09fa5e6dd726ea01ddbe1b8f7ca75c.gz
---
src/gabble-muc-channel.c | 27 +++++++++++----------------
1 files changed, 11 insertions(+), 16 deletions(-)
diff --git a/src/gabble-muc-channel.c b/src/gabble-muc-channel.c
index d92241a..f7b7c5f 100644
--- a/src/gabble-muc-channel.c
+++ b/src/gabble-muc-channel.c
@@ -825,10 +825,7 @@ gabble_muc_channel_class_init (GabbleMucChannelClass *gabble_muc_channel_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (gabble_muc_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_muc_channel_class,
sizeof (GabbleMucChannelPrivate));
@@ -918,12 +915,6 @@ gabble_muc_channel_class_init (GabbleMucChannelClass *gabble_muc_channel_class)
g_cclosure_marshal_VOID__UINT,
G_TYPE_NONE, 1, G_TYPE_UINT);
- tp_group_mixin_class_init (object_class,
- G_STRUCT_OFFSET (GabbleMucChannelClass,
- group_class),
- gabble_muc_channel_add_member,
- gabble_muc_channel_remove_member);
-
tp_properties_mixin_class_init (object_class,
G_STRUCT_OFFSET (GabbleMucChannelClass,
properties_class),
@@ -933,14 +924,18 @@ gabble_muc_channel_class_init (GabbleMucChannelClass *gabble_muc_channel_class)
tp_text_mixin_class_init (object_class,
G_STRUCT_OFFSET (GabbleMucChannelClass, text_class));
- gabble_muc_channel_class->dbus_props_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 (GabbleMucChannelClass, dbus_props_class));
+
+ if (!initialized)
+ {
+ initialized = TRUE;
+ tp_group_mixin_class_init (object_class,
+ G_STRUCT_OFFSET (GabbleMucChannelClass, group_class),
+ gabble_muc_channel_add_member,
+ gabble_muc_channel_remove_member);
+ tp_group_mixin_init_dbus_properties (object_class);
+ }
}
static void clear_join_timer (GabbleMucChannel *chan);
--
1.5.6.3
More information about the Telepathy-commits
mailing list