summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2012-04-23 13:39:02 +0200
committerXavier Claessens <xavier.claessens@collabora.co.uk>2012-04-23 13:39:02 +0200
commit032592af28cf29069b2bcf7c33fb0ae560587158 (patch)
treec993bf2f46955ca7e61425bfe4710137e10f8688
parentc193a39211ffdef8e724c153ae13bf00b31dc7eb (diff)
Use g_ptr_array_new_full() now that we can depend on glib 2.30
-rw-r--r--telepathy-glib/base-client.c14
-rw-r--r--telepathy-glib/base-contact-list.c2
-rw-r--r--telepathy-glib/call-channel.c4
-rw-r--r--telepathy-glib/call-content.c2
-rw-r--r--telepathy-glib/channel-contacts.c6
-rw-r--r--telepathy-glib/channel-dispatch-operation.c4
-rw-r--r--telepathy-glib/connection-contact-list.c4
-rw-r--r--telepathy-glib/contact.c2
-rw-r--r--telepathy-glib/util-internal.h4
-rw-r--r--telepathy-glib/util.c14
-rw-r--r--tests/dbus/cm-message.c2
11 files changed, 21 insertions, 37 deletions
diff --git a/telepathy-glib/base-client.c b/telepathy-glib/base-client.c
index 6a09d31ae..e58b38008 100644
--- a/telepathy-glib/base-client.c
+++ b/telepathy-glib/base-client.c
@@ -1739,7 +1739,7 @@ _tp_base_client_observe_channels (TpSvcClientObserver *iface,
goto out;
}
- channels = _tp_g_ptr_array_new_full (channels_arr->len, g_object_unref);
+ channels = g_ptr_array_new_full (channels_arr->len, g_object_unref);
for (i = 0; i < channels_arr->len; i++)
{
const gchar *chan_path;
@@ -1776,7 +1776,7 @@ _tp_base_client_observe_channels (TpSvcClientObserver *iface,
}
}
- requests = _tp_g_ptr_array_new_full (requests_arr->len, g_object_unref);
+ requests = g_ptr_array_new_full (requests_arr->len, g_object_unref);
for (i = 0; i < requests_arr->len; i++)
{
const gchar *req_path = g_ptr_array_index (requests_arr, i);
@@ -1964,7 +1964,7 @@ _tp_base_client_add_dispatch_operation (TpSvcClientApprover *iface,
goto out;
}
- channels = _tp_g_ptr_array_new_full (channels_arr->len, g_object_unref);
+ channels = g_ptr_array_new_full (channels_arr->len, g_object_unref);
for (i = 0; i < channels_arr->len; i++)
{
const gchar *chan_path;
@@ -2319,7 +2319,7 @@ _tp_base_client_handle_channels (TpSvcClientHandler *iface,
goto out;
}
- channels = _tp_g_ptr_array_new_full (channels_arr->len, g_object_unref);
+ channels = g_ptr_array_new_full (channels_arr->len, g_object_unref);
for (i = 0; i < channels_arr->len; i++)
{
const gchar *chan_path;
@@ -2339,7 +2339,7 @@ _tp_base_client_handle_channels (TpSvcClientHandler *iface,
g_ptr_array_add (channels, channel);
}
- requests = _tp_g_ptr_array_new_full (requests_arr->len, g_object_unref);
+ requests = g_ptr_array_new_full (requests_arr->len, g_object_unref);
for (i = 0; i < requests_arr->len; i++)
{
const gchar *req_path = g_ptr_array_index (requests_arr, i);
@@ -3078,7 +3078,7 @@ delegate_channels_ctx_new (GList *channels)
DelegateChannelsCtx *ctx = g_slice_new0 (DelegateChannelsCtx);
GList *l;
- ctx->channels = _tp_g_ptr_array_new_full (g_list_length (channels),
+ ctx->channels = g_ptr_array_new_full (g_list_length (channels),
g_object_unref);
for (l = channels; l != NULL; l = g_list_next (l))
@@ -3224,7 +3224,7 @@ tp_base_client_delegate_channels_async (TpBaseClient *self,
cd = tp_channel_dispatcher_new (self->priv->dbus);
- chans = _tp_g_ptr_array_new_full (g_list_length (channels), g_free);
+ chans = g_ptr_array_new_full (g_list_length (channels), g_free);
for (l = channels; l != NULL; l = g_list_next (l))
{
diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c
index ef0a95ecc..ecbe09b1d 100644
--- a/telepathy-glib/base-contact-list.c
+++ b/telepathy-glib/base-contact-list.c
@@ -3803,7 +3803,7 @@ tp_base_contact_list_groups_removed (TpBaseContactList *self,
return;
old_members = tp_handle_set_new (self->priv->contact_repo);
- actually_removed = _tp_g_ptr_array_new_full (n_removed + 1, g_free);
+ actually_removed = g_ptr_array_new_full (n_removed + 1, g_free);
for (i = 0; i < n_removed; i++)
{
diff --git a/telepathy-glib/call-channel.c b/telepathy-glib/call-channel.c
index cdd619d1a..b346e4f22 100644
--- a/telepathy-glib/call-channel.c
+++ b/telepathy-glib/call-channel.c
@@ -262,7 +262,7 @@ _tp_call_members_convert_array (TpConnection *connection,
GPtrArray *result;
guint i;
- result = _tp_g_ptr_array_new_full (array->len, g_object_unref);
+ result = g_ptr_array_new_full (array->len, g_object_unref);
for (i = 0; i < array->len; i++)
{
@@ -509,7 +509,7 @@ update_call_members (TpCallChannel *self,
* contact features on the factory, in which case this becomes no-op.
*/
- contacts = _tp_g_ptr_array_new_full (g_hash_table_size (updates),
+ contacts = g_ptr_array_new_full (g_hash_table_size (updates),
g_object_unref);
g_hash_table_iter_init (&iter, updates);
diff --git a/telepathy-glib/call-content.c b/telepathy-glib/call-content.c
index 7db411177..41c33e4ee 100644
--- a/telepathy-glib/call-content.c
+++ b/telepathy-glib/call-content.c
@@ -164,7 +164,7 @@ streams_removed_cb (TpCallContent *self,
if (!self->priv->properties_retrieved)
return;
- removed_streams = _tp_g_ptr_array_new_full (streams->len, g_object_unref);
+ removed_streams = g_ptr_array_new_full (streams->len, g_object_unref);
for (i = 0; i < streams->len; i++)
{
diff --git a/telepathy-glib/channel-contacts.c b/telepathy-glib/channel-contacts.c
index aaf394ab1..7bdebe3a0 100644
--- a/telepathy-glib/channel-contacts.c
+++ b/telepathy-glib/channel-contacts.c
@@ -73,7 +73,7 @@ dup_contact_array (TpChannel *self,
GPtrArray *array;
guint i;
- array = _tp_g_ptr_array_new_full (handles->len, g_object_unref);
+ array = g_ptr_array_new_full (handles->len, g_object_unref);
for (i = 0; i < handles->len; i++)
{
@@ -292,7 +292,7 @@ contacts_queue_item_set_contacts (ContactsQueueItem *item,
guint i;
g_assert (item->contacts == NULL);
- item->contacts = _tp_g_ptr_array_new_full (n_contacts, g_object_unref);
+ item->contacts = g_ptr_array_new_full (n_contacts, g_object_unref);
for (i = 0; i < n_contacts; i++)
g_ptr_array_add (item->contacts, g_object_ref (contacts[i]));
}
@@ -545,7 +545,7 @@ members_changed_prepared_cb (GObject *object,
/* For removed contacts, we have only handles because we are supposed to
* already know them. So we have to search them in our tables, construct an
* array of removed contacts and then remove them from our tables */
- removed = _tp_g_ptr_array_new_full (data->removed->len, g_object_unref);
+ removed = g_ptr_array_new_full (data->removed->len, g_object_unref);
for (i = 0; i < data->removed->len; i++)
{
TpHandle handle = g_array_index (data->removed, TpHandle, i);
diff --git a/telepathy-glib/channel-dispatch-operation.c b/telepathy-glib/channel-dispatch-operation.c
index 6dd359e9c..d37c944e9 100644
--- a/telepathy-glib/channel-dispatch-operation.c
+++ b/telepathy-glib/channel-dispatch-operation.c
@@ -516,7 +516,7 @@ update_channels_array (TpChannelDispatchOperation *self,
old = self->priv->channels;
}
- self->priv->channels = _tp_g_ptr_array_new_full (channels->len,
+ self->priv->channels = g_ptr_array_new_full (channels->len,
g_object_unref);
for (i = 0; i < channels->len; i++)
@@ -1246,7 +1246,7 @@ _tp_channel_dispatch_operation_ensure_channels (TpChannelDispatchOperation *self
return;
/* Do not just ref the GPtrArray because we'll modify its content */
- self->priv->channels = _tp_g_ptr_array_new_full (channels->len,
+ self->priv->channels = g_ptr_array_new_full (channels->len,
g_object_unref);
for (i = 0; i < channels->len; i++)
diff --git a/telepathy-glib/connection-contact-list.c b/telepathy-glib/connection-contact-list.c
index a5f71c92e..28486072f 100644
--- a/telepathy-glib/connection-contact-list.c
+++ b/telepathy-glib/connection-contact-list.c
@@ -88,9 +88,9 @@ contacts_changed_head_ready (TpConnection *self)
item = g_queue_pop_head (self->priv->contacts_changed_queue);
- added = _tp_g_ptr_array_new_full (g_hash_table_size (item->removals),
+ added = g_ptr_array_new_full (g_hash_table_size (item->removals),
g_object_unref);
- removed = _tp_g_ptr_array_new_full (item->new_contacts->len,
+ removed = g_ptr_array_new_full (item->new_contacts->len,
g_object_unref);
/* Remove contacts from roster, and build a list of contacts really removed */
diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index 367cb4066..1c7a00ef6 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -3420,7 +3420,7 @@ contact_maybe_set_contact_groups (TpContact *self,
self->priv->has_features |= CONTACT_FEATURE_FLAG_CONTACT_GROUPS;
tp_clear_pointer (&self->priv->contact_groups, g_ptr_array_unref);
- self->priv->contact_groups = _tp_g_ptr_array_new_full (
+ self->priv->contact_groups = g_ptr_array_new_full (
g_strv_length (contact_groups) + 1, g_free);
for (iter = contact_groups; *iter != NULL; iter++)
diff --git a/telepathy-glib/util-internal.h b/telepathy-glib/util-internal.h
index a7937bafe..d85110b19 100644
--- a/telepathy-glib/util-internal.h
+++ b/telepathy-glib/util-internal.h
@@ -85,10 +85,6 @@ const gchar *_tp_enum_to_nick (GType enum_type, gint value);
gboolean _tp_bind_connection_status_to_boolean (GBinding *binding,
const GValue *src_value, GValue *dest_value, gpointer user_data);
-/* Included in GLib >=2.29.15: bug #654450 */
-GPtrArray *_tp_g_ptr_array_new_full (guint reserved_size,
- GDestroyNotify element_free_func);
-
gboolean _tp_set_socket_address_type_and_access_control_type (
GHashTable *supported_sockets,
TpSocketAddressType *address_type,
diff --git a/telepathy-glib/util.c b/telepathy-glib/util.c
index 3e7ba1af0..038ff6825 100644
--- a/telepathy-glib/util.c
+++ b/telepathy-glib/util.c
@@ -1766,18 +1766,6 @@ _tp_bind_connection_status_to_boolean (GBinding *binding,
return TRUE;
}
-GPtrArray *
-_tp_g_ptr_array_new_full (guint reserved_size,
- GDestroyNotify element_free_func)
-{
- GPtrArray *array;
-
- array = g_ptr_array_sized_new (reserved_size);
- g_ptr_array_set_free_func (array, element_free_func);
-
- return array;
-}
-
/*
* _tp_determine_socket_address_type:
*
@@ -2024,7 +2012,7 @@ _tp_contacts_from_values (GHashTable *table)
if (table == NULL)
return NULL;
- contacts = _tp_g_ptr_array_new_full (g_hash_table_size (table),
+ contacts = g_ptr_array_new_full (g_hash_table_size (table),
g_object_unref);
g_hash_table_iter_init (&iter, table);
diff --git a/tests/dbus/cm-message.c b/tests/dbus/cm-message.c
index 2aafb6890..39ad3de0b 100644
--- a/tests/dbus/cm-message.c
+++ b/tests/dbus/cm-message.c
@@ -52,7 +52,7 @@ test_new_from_parts (Test *test,
const GHashTable *part;
gboolean valid;
- parts = _tp_g_ptr_array_new_full (2, (GDestroyNotify) g_hash_table_unref);
+ parts = g_ptr_array_new_full (2, (GDestroyNotify) g_hash_table_unref);
sender = tp_handle_ensure (test->contact_repo, "bob", NULL, &test->error);
g_assert_no_error (test->error);