diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-05-03 15:04:05 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-05-03 15:23:38 +0100 |
commit | 2f377dab66ef074497ff0630508535716d369cb7 (patch) | |
tree | e328498fe35f39ee6062d2ec5ee728167b973f24 | |
parent | fd81730d9c9b79ddd165fb6b0f02268b72e0b811 (diff) |
Use G_DEFINE_BOXED_TYPE for every boxed type except TpIntset
TpIntset is a bit weird because of backwards compatibility with TpIntSet,
so we can only replace that one on next.
Reviewed-by: Xavier Claessens <xavier.claessens@collabora.co.uk>
-rw-r--r-- | docs/reference/telepathy-glib-sections.txt | 3 | ||||
-rw-r--r-- | telepathy-glib/connection-avatars.c | 15 | ||||
-rw-r--r-- | telepathy-glib/connection-contact-info.c | 60 | ||||
-rw-r--r-- | telepathy-glib/connection-manager.c | 39 | ||||
-rw-r--r-- | telepathy-glib/connection.h | 4 | ||||
-rw-r--r-- | telepathy-glib/handle-set.c | 17 |
6 files changed, 24 insertions, 114 deletions
diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt index 2c9c9c275..d7d4caee9 100644 --- a/docs/reference/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib-sections.txt @@ -4263,6 +4263,9 @@ tp_contact_info_field_free TP_TYPE_CONTACT_INFO_LIST tp_contact_info_list_copy tp_contact_info_list_free +<SUBSECTION Private> +TpContactInfoSpecList +TpContactInfoList <SUBSECTION contact-list> tp_connection_get_contact_list_state tp_connection_get_contact_list_persists diff --git a/telepathy-glib/connection-avatars.c b/telepathy-glib/connection-avatars.c index fdec53099..e9c3e575d 100644 --- a/telepathy-glib/connection-avatars.c +++ b/telepathy-glib/connection-avatars.c @@ -158,20 +158,9 @@ tp_connection_get_avatar_requirements (TpConnection *self) * * Since: 0.11.4 */ -GType -tp_avatar_requirements_get_type (void) -{ - static GType type = 0; - if (G_UNLIKELY (type == 0)) - { - type = g_boxed_type_register_static (g_intern_static_string ("TpAvatarRequirements"), - (GBoxedCopyFunc) tp_avatar_requirements_copy, - (GBoxedFreeFunc) tp_avatar_requirements_destroy); - } - - return type; -} +G_DEFINE_BOXED_TYPE (TpAvatarRequirements, tp_avatar_requirements, + tp_avatar_requirements_copy, tp_avatar_requirements_destroy) /** * tp_avatar_requirements_new: diff --git a/telepathy-glib/connection-contact-info.c b/telepathy-glib/connection-contact-info.c index 07b213aa2..3349c8bdf 100644 --- a/telepathy-glib/connection-contact-info.c +++ b/telepathy-glib/connection-contact-info.c @@ -143,20 +143,9 @@ tp_contact_info_field_spec_free (TpContactInfoFieldSpec *self) * * Since: 0.11.7 */ -GType -tp_contact_info_field_spec_get_type (void) -{ - static GType type = 0; - if (G_UNLIKELY (type == 0)) - { - type = g_boxed_type_register_static (g_intern_static_string ("TpContactInfoFieldSpec"), - (GBoxedCopyFunc) tp_contact_info_field_spec_copy, - (GBoxedFreeFunc) tp_contact_info_field_spec_free); - } - - return type; -} +G_DEFINE_BOXED_TYPE (TpContactInfoFieldSpec, tp_contact_info_field_spec, + tp_contact_info_field_spec_copy, tp_contact_info_field_spec_free) /** * tp_contact_info_spec_list_copy: (skip) @@ -204,20 +193,9 @@ tp_contact_info_spec_list_free (GList *list) * * Since: 0.11.7 */ -GType -tp_contact_info_spec_list_get_type (void) -{ - static GType type = 0; - if (G_UNLIKELY (type == 0)) - { - type = g_boxed_type_register_static (g_intern_static_string ("TpContactInfoSpecList"), - (GBoxedCopyFunc) tp_contact_info_spec_list_copy, - (GBoxedFreeFunc) tp_contact_info_spec_list_free); - } - - return type; -} +G_DEFINE_BOXED_TYPE (TpContactInfoSpecList, tp_contact_info_spec_list, + tp_contact_info_spec_list_copy, tp_contact_info_spec_list_free) /** * TpContactInfoField: @@ -323,20 +301,9 @@ tp_contact_info_field_free (TpContactInfoField *self) * * Since: 0.11.7 */ -GType -tp_contact_info_field_get_type (void) -{ - static GType type = 0; - if (G_UNLIKELY (type == 0)) - { - type = g_boxed_type_register_static (g_intern_static_string ("TpContactInfoField"), - (GBoxedCopyFunc) tp_contact_info_field_copy, - (GBoxedFreeFunc) tp_contact_info_field_free); - } - - return type; -} +G_DEFINE_BOXED_TYPE (TpContactInfoField, tp_contact_info_field, + tp_contact_info_field_copy, tp_contact_info_field_free) /** * tp_contact_info_list_copy: (skip) @@ -384,20 +351,9 @@ tp_contact_info_list_free (GList *list) * * Since: 0.11.7 */ -GType -tp_contact_info_list_get_type (void) -{ - static GType type = 0; - if (G_UNLIKELY (type == 0)) - { - type = g_boxed_type_register_static (g_intern_static_string ("TpContactInfoList"), - (GBoxedCopyFunc) tp_contact_info_list_copy, - (GBoxedFreeFunc) tp_contact_info_list_free); - } - - return type; -} +G_DEFINE_BOXED_TYPE (TpContactInfoList, tp_contact_info_list, + tp_contact_info_list_copy, tp_contact_info_list_free) /** * TP_CONNECTION_FEATURE_CONTACT_INFO: diff --git a/telepathy-glib/connection-manager.c b/telepathy-glib/connection-manager.c index 2808a10c1..05fea4612 100644 --- a/telepathy-glib/connection-manager.c +++ b/telepathy-glib/connection-manager.c @@ -407,23 +407,8 @@ tp_connection_manager_protocol_free (TpConnectionManagerProtocol *proto) * Since: 0.11.3 */ - -GType -tp_connection_manager_param_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - type = g_boxed_type_register_static ( - g_intern_static_string ("TpConnectionManagerParam"), - (GBoxedCopyFunc) tp_connection_manager_param_copy, - (GBoxedFreeFunc) tp_connection_manager_param_free); - } - - return type; -} - +G_DEFINE_BOXED_TYPE (TpConnectionManagerParam, tp_connection_manager_param, + tp_connection_manager_param_copy, tp_connection_manager_param_free) /** * TP_TYPE_CONNECTION_MANAGER_PROTOCOL: @@ -433,23 +418,9 @@ tp_connection_manager_param_get_type (void) * Since: 0.11.3 */ - -GType -tp_connection_manager_protocol_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - type = g_boxed_type_register_static ( - g_intern_static_string ("TpConnectionManagerProtocol"), - (GBoxedCopyFunc) tp_connection_manager_protocol_copy, - (GBoxedFreeFunc) tp_connection_manager_protocol_free); - } - - return type; -} - +G_DEFINE_BOXED_TYPE (TpConnectionManagerProtocol, + tp_connection_manager_protocol, + tp_connection_manager_protocol_copy, tp_connection_manager_protocol_free) typedef struct { TpConnectionManager *cm; diff --git a/telepathy-glib/connection.h b/telepathy-glib/connection.h index 71a739c32..ea36129e6 100644 --- a/telepathy-glib/connection.h +++ b/telepathy-glib/connection.h @@ -48,6 +48,8 @@ TpContactInfoFieldSpec *tp_contact_info_field_spec_copy ( const TpContactInfoFieldSpec *self); void tp_contact_info_field_spec_free (TpContactInfoFieldSpec *self); +typedef GList TpContactInfoSpecList; + #define TP_TYPE_CONTACT_INFO_SPEC_LIST (tp_contact_info_spec_list_get_type ()) GType tp_contact_info_spec_list_get_type (void); GList *tp_contact_info_spec_list_copy (GList *list); @@ -71,6 +73,8 @@ TpContactInfoField *tp_contact_info_field_new (const gchar *field_name, TpContactInfoField *tp_contact_info_field_copy (const TpContactInfoField *self); void tp_contact_info_field_free (TpContactInfoField *self); +typedef GList TpContactInfoList; + #define TP_TYPE_CONTACT_INFO_LIST (tp_contact_info_list_get_type ()) GType tp_contact_info_list_get_type (void); GList *tp_contact_info_list_copy (GList *list); diff --git a/telepathy-glib/handle-set.c b/telepathy-glib/handle-set.c index d2c72c4eb..ef4011225 100644 --- a/telepathy-glib/handle-set.c +++ b/telepathy-glib/handle-set.c @@ -53,21 +53,8 @@ struct _TpHandleSet * Since: 0.11.6 */ -GType -tp_handle_set_get_type (void) -{ - static GType type = 0; - - if (G_UNLIKELY (type == 0)) - { - type = g_boxed_type_register_static ( - g_intern_static_string ("TpHandleSet"), - (GBoxedCopyFunc) tp_handle_set_copy, - (GBoxedFreeFunc) tp_handle_set_destroy); - } - - return type; -} +G_DEFINE_BOXED_TYPE (TpHandleSet, tp_handle_set, tp_handle_set_copy, + tp_handle_set_destroy) /** * tp_handle_set_new: (skip) |