diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-03-02 18:18:56 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-04-12 11:43:53 +0100 |
commit | ac5d4e98cdd52d9f0a55cc1890d2319c912329b2 (patch) | |
tree | 7da874ae0c465dc5e54055a13b82edc5b6bc202a /examples/cm | |
parent | 6d546be194d9752e883bb86b70cb1641709413f5 (diff) | |
download | telepathy-glib-ac5d4e98cdd52d9f0a55cc1890d2319c912329b2.tar.gz |
Don't use the deprecated TpBaseChannelClass.interfaces property
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48547
Diffstat (limited to 'examples/cm')
-rw-r--r-- | examples/cm/call/call-channel.c | 17 | ||||
-rw-r--r-- | examples/cm/channelspecific/room.c | 17 | ||||
-rw-r--r-- | examples/cm/echo-message-parts/chan.c | 20 |
3 files changed, 37 insertions, 17 deletions
diff --git a/examples/cm/call/call-channel.c b/examples/cm/call/call-channel.c index 677c4951a..1e67bc10b 100644 --- a/examples/cm/call/call-channel.c +++ b/examples/cm/call/call-channel.c @@ -77,10 +77,17 @@ struct _ExampleCallChannelPrivate gboolean closed; }; -static const char * example_call_channel_interfaces[] = { - TP_IFACE_CHANNEL_INTERFACE_HOLD, - NULL -}; +static GPtrArray * +example_call_channel_get_interfaces (TpBaseChannel *self) +{ + GPtrArray *interfaces; + + interfaces = TP_BASE_CHANNEL_CLASS ( + example_call_channel_parent_class)->get_interfaces (self); + + g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_HOLD); + return interfaces; +} /* In practice you need one for audio, plus one per video (e.g. a * presentation might have separate video contents for the slides @@ -333,7 +340,7 @@ example_call_channel_class_init (ExampleCallChannelClass *klass) call_class->hangup = call_hangup; base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT; - base_class->interfaces = example_call_channel_interfaces; + base_class->get_interfaces = example_call_channel_get_interfaces; base_class->close = close_channel; object_class->constructed = constructed; diff --git a/examples/cm/channelspecific/room.c b/examples/cm/channelspecific/room.c index c55d929df..6e78d116f 100644 --- a/examples/cm/channelspecific/room.c +++ b/examples/cm/channelspecific/room.c @@ -38,13 +38,18 @@ struct _ExampleCSHRoomChannelPrivate guint simulation_delay; }; +static GPtrArray * +example_csh_room_channel_get_interfaces (TpBaseChannel *self) +{ + GPtrArray *interfaces; -static const char * example_csh_room_channel_interfaces[] = { - TP_IFACE_CHANNEL_INTERFACE_GROUP, - TP_IFACE_CHANNEL_INTERFACE_MESSAGES, - NULL -}; + interfaces = TP_BASE_CHANNEL_CLASS (example_csh_room_channel_parent_class)-> + get_interfaces (self); + g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_GROUP); + g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_MESSAGES); + return interfaces; +}; static void example_csh_room_channel_init (ExampleCSHRoomChannel *self) @@ -392,7 +397,7 @@ example_csh_room_channel_class_init (ExampleCSHRoomChannelClass *klass) base_class->channel_type = TP_IFACE_CHANNEL_TYPE_TEXT; base_class->target_handle_type = TP_HANDLE_TYPE_ROOM; - base_class->interfaces = example_csh_room_channel_interfaces; + base_class->get_interfaces = example_csh_room_channel_get_interfaces; base_class->close = example_csh_room_channel_close; diff --git a/examples/cm/echo-message-parts/chan.c b/examples/cm/echo-message-parts/chan.c index 591692ca4..320f42868 100644 --- a/examples/cm/echo-message-parts/chan.c +++ b/examples/cm/echo-message-parts/chan.c @@ -37,11 +37,19 @@ G_DEFINE_TYPE_WITH_CODE (ExampleEcho2Channel, /* type definition stuff */ -static const char * example_echo_2_channel_interfaces[] = { - TP_IFACE_CHANNEL_INTERFACE_MESSAGES, - TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE, - TP_IFACE_CHANNEL_INTERFACE_SMS, - NULL }; +static GPtrArray * +example_echo_2_channel_get_interfaces (TpBaseChannel *self) +{ + GPtrArray *interfaces; + + interfaces = TP_BASE_CHANNEL_CLASS (example_echo_2_channel_parent_class)-> + get_interfaces (self); + + g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_MESSAGES); + g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_DESTROYABLE); + g_ptr_array_add (interfaces, TP_IFACE_CHANNEL_INTERFACE_SMS); + return interfaces; +}; enum { @@ -315,7 +323,7 @@ example_echo_2_channel_class_init (ExampleEcho2ChannelClass *klass) base_class->channel_type = TP_IFACE_CHANNEL_TYPE_TEXT; base_class->target_handle_type = TP_HANDLE_TYPE_CONTACT; - base_class->interfaces = example_echo_2_channel_interfaces; + base_class->get_interfaces = example_echo_2_channel_get_interfaces; base_class->close = example_echo_2_channel_close; base_class->fill_immutable_properties = example_echo_2_channel_fill_immutable_properties; |