[telepathy-qt4/master] Merge 'contactlist' example CM from latest tp-glib.
Andre Moreira Magalhaes (andrunko)
andre.magalhaes at collabora.co.uk
Wed Jul 22 15:37:44 PDT 2009
---
tests/lib/contactlist/conn.c | 9 ++++-----
tests/lib/contactlist/contact-list-manager.c | 18 ++++++++----------
tests/lib/contactlist/contact-list.c | 5 ++++-
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/tests/lib/contactlist/conn.c b/tests/lib/contactlist/conn.c
index 335520e..2349dd7 100644
--- a/tests/lib/contactlist/conn.c
+++ b/tests/lib/contactlist/conn.c
@@ -280,13 +280,12 @@ aliasing_fill_contact_attributes (GObject *object,
for (i = 0; i < contacts->len; i++)
{
TpHandle contact = g_array_index (contacts, guint, i);
- GValue *value = tp_g_value_slice_new (G_TYPE_STRING);
- g_value_set_string (value,
- example_contact_list_manager_get_alias (self->priv->list_manager,
- contact));
tp_contacts_mixin_set_contact_attribute (attributes, contact,
- TP_IFACE_CONNECTION_INTERFACE_ALIASING "/alias", value);
+ TP_IFACE_CONNECTION_INTERFACE_ALIASING "/alias",
+ tp_g_value_slice_new_string (
+ example_contact_list_manager_get_alias (self->priv->list_manager,
+ contact)));
}
}
diff --git a/tests/lib/contactlist/contact-list-manager.c b/tests/lib/contactlist/contact-list-manager.c
index 60896c2..082fc30 100644
--- a/tests/lib/contactlist/contact-list-manager.c
+++ b/tests/lib/contactlist/contact-list-manager.c
@@ -841,18 +841,16 @@ example_contact_list_manager_foreach_channel_class (TpChannelManager *manager,
{
GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal,
NULL, (GDestroyNotify) tp_g_value_slice_free);
- GValue *ctype, *htype;
- ctype = tp_g_value_slice_new (G_TYPE_STRING);
- g_value_set_static_string (ctype, TP_IFACE_CHANNEL_TYPE_CONTACT_LIST);
- g_hash_table_insert (table, TP_IFACE_CHANNEL ".ChannelType", ctype);
-
- htype = tp_g_value_slice_new (G_TYPE_UINT); /* initialized later */
- g_hash_table_insert (table, TP_IFACE_CHANNEL ".TargetHandleType", htype);
-
- g_value_set_uint (htype, TP_HANDLE_TYPE_LIST);
+ g_hash_table_insert (table, TP_IFACE_CHANNEL ".ChannelType",
+ tp_g_value_slice_new_static_string (
+ TP_IFACE_CHANNEL_TYPE_CONTACT_LIST));
+ g_hash_table_insert (table, TP_IFACE_CHANNEL ".TargetHandleType",
+ tp_g_value_slice_new_uint (TP_HANDLE_TYPE_LIST));
func (manager, table, allowed_properties, user_data);
- g_value_set_uint (htype, TP_HANDLE_TYPE_GROUP);
+
+ g_hash_table_insert (table, TP_IFACE_CHANNEL ".TargetHandleType",
+ tp_g_value_slice_new_uint (TP_HANDLE_TYPE_GROUP));
func (manager, table, allowed_properties, user_data);
g_hash_table_destroy (table);
diff --git a/tests/lib/contactlist/contact-list.c b/tests/lib/contactlist/contact-list.c
index 381d405..c8af83b 100644
--- a/tests/lib/contactlist/contact-list.c
+++ b/tests/lib/contactlist/contact-list.c
@@ -1,5 +1,5 @@
/*
- * An example ContactList channel with handle type LIST
+ * An example ContactList channel with handle type LIST or GROUP
*
* Copyright © 2009 Collabora Ltd. <http://www.collabora.co.uk/>
* Copyright © 2009 Nokia Corporation
@@ -26,6 +26,7 @@ static void channel_iface_init (gpointer iface, gpointer data);
static void list_channel_iface_init (gpointer iface, gpointer data);
static void group_channel_iface_init (gpointer iface, gpointer data);
+/* Abstract base class */
G_DEFINE_TYPE_WITH_CODE (ExampleContactListBase, example_contact_list_base,
G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, channel_iface_init);
@@ -37,10 +38,12 @@ G_DEFINE_TYPE_WITH_CODE (ExampleContactListBase, example_contact_list_base,
G_IMPLEMENT_INTERFACE (TP_TYPE_EXPORTABLE_CHANNEL, NULL);
G_IMPLEMENT_INTERFACE (TP_TYPE_CHANNEL_IFACE, NULL))
+/* Subclass for handle type LIST */
G_DEFINE_TYPE_WITH_CODE (ExampleContactList, example_contact_list,
EXAMPLE_TYPE_CONTACT_LIST_BASE,
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, list_channel_iface_init))
+/* Subclass for handle type GROUP */
G_DEFINE_TYPE_WITH_CODE (ExampleContactGroup, example_contact_group,
EXAMPLE_TYPE_CONTACT_LIST_BASE,
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_CHANNEL, group_channel_iface_init))
--
1.5.6.5
More information about the telepathy-commits
mailing list