summaryrefslogtreecommitdiff
path: root/telepathy-glib/channel-contacts.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-04-11 11:59:32 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-04-12 11:36:44 +0100
commit2e72176e91c5e6b34ffdc2625aa7cd89381e662e (patch)
treea026a8ee9da37c21c3fd9c5dd00fc68872317079 /telepathy-glib/channel-contacts.c
parent0b77bfd9e045e5c4b9df0f072d32052146c2b648 (diff)
downloadtelepathy-glib-2e72176e91c5e6b34ffdc2625aa7cd89381e662e.tar.gz
channel-contacts: merge contacts_queue_item_new into contacts_queue_item
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45554 Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'telepathy-glib/channel-contacts.c')
-rw-r--r--telepathy-glib/channel-contacts.c40
1 files changed, 11 insertions, 29 deletions
diff --git a/telepathy-glib/channel-contacts.c b/telepathy-glib/channel-contacts.c
index dc381a3f3..efaa9a04c 100644
--- a/telepathy-glib/channel-contacts.c
+++ b/telepathy-glib/channel-contacts.c
@@ -242,22 +242,6 @@ struct _ContactsQueueItem
GArray *handles;
};
-static ContactsQueueItem *
-contacts_queue_item_new (GPtrArray *contacts,
- GPtrArray *ids,
- GArray *handles)
-{
- ContactsQueueItem *item;
-
- item = g_slice_new (ContactsQueueItem);
- item->contacts = contacts != NULL ? g_ptr_array_ref (contacts) : NULL;
- item->ids = ids != NULL ? g_ptr_array_ref (ids) : NULL;
- item->handles = handles != NULL ? g_array_ref (handles) : NULL;
- item->result = NULL;
-
- return item;
-}
-
static void
contacts_queue_item_free (ContactsQueueItem *item)
{
@@ -445,10 +429,17 @@ process_contacts_queue (TpChannel *self)
static void
contacts_queue_item (TpChannel *self,
- ContactsQueueItem *item,
+ GPtrArray *contacts,
+ GPtrArray *ids,
+ GArray *handles,
GAsyncReadyCallback callback,
gpointer user_data)
{
+ ContactsQueueItem *item = g_slice_new (ContactsQueueItem);
+
+ item->contacts = contacts != NULL ? g_ptr_array_ref (contacts) : NULL;
+ item->ids = ids != NULL ? g_ptr_array_ref (ids) : NULL;
+ item->handles = handles != NULL ? g_array_ref (handles) : NULL;
item->result = g_simple_async_result_new ((GObject *) self,
callback, user_data, contacts_queue_item);
@@ -464,10 +455,7 @@ _tp_channel_contacts_queue_prepare_async (TpChannel *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- ContactsQueueItem *item;
-
- item = contacts_queue_item_new (contacts, NULL, NULL);
- contacts_queue_item (self, item, callback, user_data);
+ contacts_queue_item (self, contacts, NULL, NULL, callback, user_data);
}
void
@@ -476,10 +464,7 @@ _tp_channel_contacts_queue_prepare_by_id_async (TpChannel *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- ContactsQueueItem *item;
-
- item = contacts_queue_item_new (NULL, ids, NULL);
- contacts_queue_item (self, item, callback, user_data);
+ contacts_queue_item (self, NULL, ids, NULL, callback, user_data);
}
void
@@ -488,10 +473,7 @@ _tp_channel_contacts_queue_prepare_by_handle_async (TpChannel *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
- ContactsQueueItem *item;
-
- item = contacts_queue_item_new (NULL, NULL, handles);
- contacts_queue_item (self, item, callback, user_data);
+ contacts_queue_item (self, NULL, NULL, handles, callback, user_data);
}
gboolean