summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2012-07-05 16:52:51 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2012-07-05 16:52:51 +0100
commitec9a04f139900957a59630a7f74015f55dffe100 (patch)
treec28da7760f7bf19b68b1fd1a2d3aedb780ebfb3c
parent43621978934824f2b6815ef5d5e20887d59bca28 (diff)
example protocols: update to use get_interfaces_array vfunc
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--examples/cm/call/protocol.c7
-rw-r--r--examples/cm/channelspecific/protocol.c7
-rw-r--r--examples/cm/contactlist/protocol.c7
-rw-r--r--examples/cm/echo-message-parts/protocol.c21
-rw-r--r--examples/cm/extended/protocol.c7
5 files changed, 12 insertions, 37 deletions
diff --git a/examples/cm/call/protocol.c b/examples/cm/call/protocol.c
index 4233fdefc..f65c99f75 100644
--- a/examples/cm/call/protocol.c
+++ b/examples/cm/call/protocol.c
@@ -134,12 +134,6 @@ identify_account (TpBaseProtocol *self G_GNUC_UNUSED,
return NULL;
}
-static GStrv
-get_interfaces (TpBaseProtocol *self)
-{
- return NULL;
-}
-
static void
get_connection_details (TpBaseProtocol *self G_GNUC_UNUSED,
GStrv *connection_interfaces,
@@ -183,6 +177,5 @@ example_call_protocol_class_init (
base_class->normalize_contact = normalize_contact;
base_class->identify_account = identify_account;
- base_class->get_interfaces = get_interfaces;
base_class->get_connection_details = get_connection_details;
}
diff --git a/examples/cm/channelspecific/protocol.c b/examples/cm/channelspecific/protocol.c
index 112f7cef0..6874689c0 100644
--- a/examples/cm/channelspecific/protocol.c
+++ b/examples/cm/channelspecific/protocol.c
@@ -174,12 +174,6 @@ identify_account (TpBaseProtocol *self G_GNUC_UNUSED,
return NULL;
}
-static GStrv
-get_interfaces (TpBaseProtocol *self)
-{
- return NULL;
-}
-
static void
get_connection_details (TpBaseProtocol *self G_GNUC_UNUSED,
GStrv *connection_interfaces,
@@ -223,6 +217,5 @@ example_csh_protocol_class_init (
base_class->normalize_contact = normalize_contact;
base_class->identify_account = identify_account;
- base_class->get_interfaces = get_interfaces;
base_class->get_connection_details = get_connection_details;
}
diff --git a/examples/cm/contactlist/protocol.c b/examples/cm/contactlist/protocol.c
index fcc05ebed..3f76e1785 100644
--- a/examples/cm/contactlist/protocol.c
+++ b/examples/cm/contactlist/protocol.c
@@ -134,12 +134,6 @@ identify_account (TpBaseProtocol *self G_GNUC_UNUSED,
return NULL;
}
-static GStrv
-get_interfaces (TpBaseProtocol *self)
-{
- return NULL;
-}
-
static void
get_connection_details (TpBaseProtocol *self G_GNUC_UNUSED,
GStrv *connection_interfaces,
@@ -183,6 +177,5 @@ example_contact_list_protocol_class_init (
base_class->normalize_contact = normalize_contact;
base_class->identify_account = identify_account;
- base_class->get_interfaces = get_interfaces;
base_class->get_connection_details = get_connection_details;
}
diff --git a/examples/cm/echo-message-parts/protocol.c b/examples/cm/echo-message-parts/protocol.c
index 7981fedaa..4512216b9 100644
--- a/examples/cm/echo-message-parts/protocol.c
+++ b/examples/cm/echo-message-parts/protocol.c
@@ -21,11 +21,6 @@ G_DEFINE_TYPE_WITH_CODE (ExampleEcho2Protocol, example_echo_2_protocol,
TP_TYPE_BASE_PROTOCOL,
G_IMPLEMENT_INTERFACE (TP_TYPE_PROTOCOL_ADDRESSING, addressing_iface_init))
-const gchar * const protocol_interfaces[] = {
- TP_IFACE_PROTOCOL_INTERFACE_AVATARS,
- TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING,
- NULL };
-
const gchar * const supported_avatar_mime_types[] = {
"image/png",
"image/jpeg",
@@ -127,10 +122,18 @@ identify_account (TpBaseProtocol *self G_GNUC_UNUSED,
return NULL;
}
-static GStrv
-get_interfaces (TpBaseProtocol *self)
+static GPtrArray *
+get_interfaces_array (TpBaseProtocol *self)
{
- return g_strdupv ((GStrv) protocol_interfaces);
+ GPtrArray *interfaces;
+
+ interfaces = TP_BASE_PROTOCOL_CLASS (
+ example_echo_2_protocol_parent_class)->get_interfaces_array (self);
+
+ g_ptr_array_add (interfaces, TP_IFACE_PROTOCOL_INTERFACE_AVATARS);
+ g_ptr_array_add (interfaces, TP_IFACE_PROTOCOL_INTERFACE_ADDRESSING);
+
+ return interfaces;
}
static void
@@ -235,7 +238,7 @@ example_echo_2_protocol_class_init (
base_class->normalize_contact = normalize_contact;
base_class->identify_account = identify_account;
- base_class->get_interfaces = get_interfaces;
+ base_class->get_interfaces_array = get_interfaces_array;
base_class->get_connection_details = get_connection_details;
base_class->get_avatar_details = get_avatar_details;
}
diff --git a/examples/cm/extended/protocol.c b/examples/cm/extended/protocol.c
index 0a85a504c..0b20659bd 100644
--- a/examples/cm/extended/protocol.c
+++ b/examples/cm/extended/protocol.c
@@ -106,12 +106,6 @@ identify_account (TpBaseProtocol *self G_GNUC_UNUSED,
return NULL;
}
-static GStrv
-get_interfaces (TpBaseProtocol *self)
-{
- return NULL;
-}
-
static void
get_connection_details (TpBaseProtocol *self G_GNUC_UNUSED,
GStrv *connection_interfaces,
@@ -167,6 +161,5 @@ example_extended_protocol_class_init (
base_class->normalize_contact = normalize_contact;
base_class->identify_account = identify_account;
- base_class->get_interfaces = get_interfaces;
base_class->get_connection_details = get_connection_details;
}