Patch: register types in tinymail using GOnce
- From: José Dapena Paz <jdapena igalia com>
- To: tinymail-devel-list <tinymail-devel-list gnome org>
- Subject: Patch: register types in tinymail using GOnce
- Date: Wed, 14 May 2008 19:07:29 +0200
Hi,
This patch is for using GOnce on registering tinymail types in GType
system. This is required for ensuring that registering is thread safe
(it can happen that two threads register the same type in parallel, and
this can cause problems).
Changelog entry is:
* Use GOnce registering all types in tinymail to make
registering thread-safe.
--
José Dapena Paz <jdapena igalia com>
Igalia
Index: libtinymail-acap/tny-acap-account-store.c
===================================================================
--- libtinymail-acap/tny-acap-account-store.c (revision 3665)
+++ libtinymail-acap/tny-acap-account-store.c (working copy)
@@ -225,40 +225,45 @@
}
-GType
-tny_acap_account_store_get_type (void)
+static gpointer
+tny_acap_account_store_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyAcapAccountStoreClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_acap_account_store_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyAcapAccountStore),
- 0, /* n_preallocs */
- tny_acap_account_store_instance_init /* instance_init */
+ sizeof (TnyAcapAccountStoreClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_acap_account_store_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyAcapAccountStore),
+ 0, /* n_preallocs */
+ tny_acap_account_store_instance_init /* instance_init */
};
-
- static const GInterfaceInfo tny_account_store_info =
+
+ static const GInterfaceInfo tny_account_store_info =
{
- (GInterfaceInitFunc) tny_account_store_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_account_store_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyAcapAccountStore",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_ACCOUNT_STORE,
+ &tny_account_store_info);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyAcapAccountStore",
- &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_ACCOUNT_STORE,
- &tny_account_store_info);
- }
-
- return type;
+GType
+tny_acap_account_store_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_acap_account_store_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-gpe/tny-gpe-device.c
===================================================================
--- libtinymail-gpe/tny-gpe-device.c (revision 3665)
+++ libtinymail-gpe/tny-gpe-device.c (working copy)
@@ -201,42 +201,45 @@
return;
}
-GType
-tny_gpe_device_get_type (void)
+static gpointer
+tny_gpe_device_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyGpeDeviceClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_gpe_device_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyGpeDevice),
- 0, /* n_preallocs */
- tny_gpe_device_instance_init /* instance_init */
+ sizeof (TnyGpeDeviceClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_gpe_device_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyGpeDevice),
+ 0, /* n_preallocs */
+ tny_gpe_device_instance_init /* instance_init */
};
-
- static const GInterfaceInfo tny_device_info =
+
+ static const GInterfaceInfo tny_device_info =
{
- (GInterfaceInitFunc) tny_device_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_device_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGpeDevice",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_DEVICE,
+ &tny_device_info);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGpeDevice",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_DEVICE,
- &tny_device_info);
-
- }
-
- return type;
+GType
+tny_gpe_device_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gpe_device_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-gpe/tny-gpe-account-store.c
===================================================================
--- libtinymail-gpe/tny-gpe-account-store.c (revision 3665)
+++ libtinymail-gpe/tny-gpe-account-store.c (working copy)
@@ -553,40 +553,45 @@
}
-GType
-tny_gpe_account_store_get_type (void)
+static gpointer
+tny_gpe_account_store_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyGpeAccountStoreClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_gpe_account_store_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyGpeAccountStore),
- 0, /* n_preallocs */
- tny_gpe_account_store_instance_init /* instance_init */
+ sizeof (TnyGpeAccountStoreClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_gpe_account_store_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyGpeAccountStore),
+ 0, /* n_preallocs */
+ tny_gpe_account_store_instance_init /* instance_init */
};
-
- static const GInterfaceInfo tny_account_store_info =
+
+ static const GInterfaceInfo tny_account_store_info =
{
- (GInterfaceInitFunc) tny_account_store_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_account_store_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGpeAccountStore",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_ACCOUNT_STORE,
+ &tny_account_store_info);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGpeAccountStore",
- &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_ACCOUNT_STORE,
- &tny_account_store_info);
- }
-
- return type;
+GType
+tny_gpe_account_store_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gpe_account_store_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-gpe/tny-gpe-platform-factory.c
===================================================================
--- libtinymail-gpe/tny-gpe-platform-factory.c (revision 3665)
+++ libtinymail-gpe/tny-gpe-platform-factory.c (working copy)
@@ -158,41 +158,45 @@
return;
}
-GType
-tny_gpe_platform_factory_get_type (void)
+static gpointer
+tny_gpe_platform_factory_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyGpePlatformFactoryClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_gpe_platform_factory_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyGpePlatformFactory),
- 0, /* n_preallocs */
- tny_gpe_platform_factory_instance_init /* instance_init */
+ sizeof (TnyGpePlatformFactoryClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_gpe_platform_factory_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyGpePlatformFactory),
+ 0, /* n_preallocs */
+ tny_gpe_platform_factory_instance_init /* instance_init */
};
-
- static const GInterfaceInfo tny_platform_factory_info =
+
+ static const GInterfaceInfo tny_platform_factory_info =
{
- (GInterfaceInitFunc) tny_platform_factory_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_platform_factory_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGpePlatformFactory",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_PLATFORM_FACTORY,
+ &tny_platform_factory_info);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGpePlatformFactory",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_PLATFORM_FACTORY,
- &tny_platform_factory_info);
-
- }
-
- return type;
+GType
+tny_gpe_platform_factory_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gpe_platform_factory_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-bs-msg-receive-strategy.c
===================================================================
--- libtinymail-camel/tny-camel-bs-msg-receive-strategy.c (revision 3665)
+++ libtinymail-camel/tny-camel-bs-msg-receive-strategy.c (working copy)
@@ -206,13 +206,11 @@
}
-GType
-tny_camel_bs_msg_receive_strategy_get_type (void)
+static gpointer
+tny_camel_bs_msg_receive_strategy_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+ static const GTypeInfo info =
{
sizeof (TnyCamelBsMsgReceiveStrategyClass),
NULL, /* base_init */
@@ -227,20 +225,27 @@
};
- static const GInterfaceInfo tny_msg_receive_strategy_info =
+ static const GInterfaceInfo tny_msg_receive_strategy_info =
{
(GInterfaceInitFunc) tny_msg_receive_strategy_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelBsMsgReceiveStrategy",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_MSG_RECEIVE_STRATEGY,
+ &tny_msg_receive_strategy_info);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelBsMsgReceiveStrategy",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_MSG_RECEIVE_STRATEGY,
- &tny_msg_receive_strategy_info);
-
- }
- return type;
+GType
+tny_camel_bs_msg_receive_strategy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_camel_bs_msg_receive_strategy_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-folder.c
===================================================================
--- libtinymail-camel/tny-camel-folder.c (revision 3665)
+++ libtinymail-camel/tny-camel-folder.c (working copy)
@@ -6240,6 +6240,51 @@
return;
}
+static gpointer
+tny_camel_folder_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelFolderClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_folder_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelFolder),
+ 0, /* n_preallocs */
+ tny_camel_folder_instance_init /* instance_init */
+ };
+
+ static const GInterfaceInfo tny_folder_info =
+ {
+ (GInterfaceInitFunc) tny_folder_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ static const GInterfaceInfo tny_folder_store_info =
+ {
+ (GInterfaceInitFunc) tny_folder_store_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelFolder",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_FOLDER_STORE,
+ &tny_folder_store_info);
+
+ g_type_add_interface_static (type, TNY_TYPE_FOLDER,
+ &tny_folder_info);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_folder_get_type:
*
@@ -6250,7 +6295,7 @@
GType
tny_camel_folder_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -6261,45 +6306,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelFolderClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_folder_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelFolder),
- 0, /* n_preallocs */
- tny_camel_folder_instance_init /* instance_init */
- };
-
- static const GInterfaceInfo tny_folder_info =
- {
- (GInterfaceInitFunc) tny_folder_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- static const GInterfaceInfo tny_folder_store_info =
- {
- (GInterfaceInitFunc) tny_folder_store_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelFolder",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_FOLDER_STORE,
- &tny_folder_store_info);
-
- g_type_add_interface_static (type, TNY_TYPE_FOLDER,
- &tny_folder_info);
- }
-
- return type;
+ g_once (&once, tny_camel_folder_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-msg-remove-strategy.c
===================================================================
--- libtinymail-camel/tny-camel-msg-remove-strategy.c (revision 3665)
+++ libtinymail-camel/tny-camel-msg-remove-strategy.c (working copy)
@@ -147,41 +147,46 @@
return;
}
-GType
-tny_camel_msg_remove_strategy_get_type (void)
+static gpointer
+tny_camel_msg_remove_strategy_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyCamelMsgRemoveStrategyClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_msg_remove_strategy_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelMsgRemoveStrategy),
- 0, /* n_preallocs */
- tny_camel_msg_remove_strategy_instance_init, /* instance_init */
- NULL
+ sizeof (TnyCamelMsgRemoveStrategyClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_msg_remove_strategy_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelMsgRemoveStrategy),
+ 0, /* n_preallocs */
+ tny_camel_msg_remove_strategy_instance_init, /* instance_init */
+ NULL
};
-
- static const GInterfaceInfo tny_camel_msg_remove_strategy_info =
+
+ static const GInterfaceInfo tny_camel_msg_remove_strategy_info =
{
- (GInterfaceInitFunc) tny_camel_msg_remove_strategy_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_camel_msg_remove_strategy_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelMsgRemoveStrategy",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_MSG_REMOVE_STRATEGY,
+ &tny_camel_msg_remove_strategy_info);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelMsgRemoveStrategy",
- &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_MSG_REMOVE_STRATEGY,
- &tny_camel_msg_remove_strategy_info);
- }
-
- return type;
+GType
+tny_camel_msg_remove_strategy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_camel_msg_remove_strategy_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-nntp-folder.c
===================================================================
--- libtinymail-camel/tny-camel-nntp-folder.c (revision 3665)
+++ libtinymail-camel/tny-camel-nntp-folder.c (working copy)
@@ -121,6 +121,31 @@
return;
}
+static gpointer
+tny_camel_nntp_folder_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelNNTPFolderClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_nntp_folder_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelNNTPFolder),
+ 0, /* n_preallocs */
+ tny_camel_nntp_folder_instance_init /* instance_init */
+ };
+
+ type = g_type_register_static (TNY_TYPE_CAMEL_FOLDER,
+ "TnyCamelNNTPFolder",
+ &info, 0);
+
+ return GPOINTER_TO_UINT (type);
+}
+
/**
* tny_camel_nntp_folder_get_type:
*
@@ -131,7 +156,7 @@
GType
tny_camel_nntp_folder_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -141,27 +166,8 @@
camel_type_init ();
_camel_type_init_done = TRUE;
}
+
+ g_once (&once, tny_camel_nntp_folder_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelNNTPFolderClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_nntp_folder_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelNNTPFolder),
- 0, /* n_preallocs */
- tny_camel_nntp_folder_instance_init /* instance_init */
- };
-
- type = g_type_register_static (TNY_TYPE_CAMEL_FOLDER,
- "TnyCamelNNTPFolder",
- &info, 0);
- }
-
- return type;
}
-
Index: libtinymail-camel/tny-camel-mime-part.c
===================================================================
--- libtinymail-camel/tny-camel-mime-part.c (revision 3665)
+++ libtinymail-camel/tny-camel-mime-part.c (working copy)
@@ -1462,6 +1462,42 @@
return;
}
+static gpointer
+tny_camel_mime_part_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelMimePartClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_mime_part_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelMimePart),
+ 0, /* n_preallocs */
+ tny_camel_mime_part_instance_init, /* instance_init */
+ NULL
+ };
+
+ static const GInterfaceInfo tny_mime_part_info =
+ {
+ (GInterfaceInitFunc) tny_mime_part_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelMimePart",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART,
+ &tny_mime_part_info);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_mime_part_get_type:
*
@@ -1472,7 +1508,7 @@
GType
tny_camel_mime_part_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -1483,36 +1519,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelMimePartClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_mime_part_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelMimePart),
- 0, /* n_preallocs */
- tny_camel_mime_part_instance_init, /* instance_init */
- NULL
- };
-
- static const GInterfaceInfo tny_mime_part_info =
- {
- (GInterfaceInitFunc) tny_mime_part_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelMimePart",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART,
- &tny_mime_part_info);
- }
-
- return type;
+ g_once (&once, tny_camel_mime_part_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-recover-connection-policy.c
===================================================================
--- libtinymail-camel/tny-camel-recover-connection-policy.c (revision 3665)
+++ libtinymail-camel/tny-camel-recover-connection-policy.c (working copy)
@@ -181,13 +181,11 @@
}
-GType
-tny_camel_recover_connection_policy_get_type (void)
+static gpointer
+tny_camel_recover_connection_policy_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+ static const GTypeInfo info =
{
sizeof (TnyCamelRecoverConnectionPolicyClass),
NULL, /* base_init */
@@ -202,20 +200,27 @@
};
- static const GInterfaceInfo tny_connection_policy_info =
+ static const GInterfaceInfo tny_connection_policy_info =
{
(GInterfaceInitFunc) tny_connection_policy_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelRecoverConnectionPolicy",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelRecoverConnectionPolicy",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_CONNECTION_POLICY,
+ &tny_connection_policy_info);
+
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_CONNECTION_POLICY,
- &tny_connection_policy_info);
-
- }
- return type;
+GType
+tny_camel_recover_connection_policy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_camel_recover_connection_policy_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-pop-remote-msg-remove-strategy.c
===================================================================
--- libtinymail-camel/tny-camel-pop-remote-msg-remove-strategy.c (revision 3665)
+++ libtinymail-camel/tny-camel-pop-remote-msg-remove-strategy.c (working copy)
@@ -172,41 +172,46 @@
return;
}
-GType
-tny_camel_pop_remote_msg_remove_strategy_get_type (void)
+static gpointer
+tny_camel_pop_remote_msg_remove_strategy_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyCamelPopRemoteMsgRemoveStrategyClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_pop_remote_msg_remove_strategy_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelPopRemoteMsgRemoveStrategy),
- 0, /* n_preallocs */
- tny_camel_pop_remote_msg_remove_strategy_instance_init, /* instance_init */
- NULL
+ sizeof (TnyCamelPopRemoteMsgRemoveStrategyClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_pop_remote_msg_remove_strategy_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelPopRemoteMsgRemoveStrategy),
+ 0, /* n_preallocs */
+ tny_camel_pop_remote_msg_remove_strategy_instance_init, /* instance_init */
+ NULL
};
-
- static const GInterfaceInfo tny_camel_pop_remote_msg_remove_strategy_info =
+
+ static const GInterfaceInfo tny_camel_pop_remote_msg_remove_strategy_info =
{
- (GInterfaceInitFunc) tny_camel_pop_remote_msg_remove_strategy_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_camel_pop_remote_msg_remove_strategy_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelPopRemoteMsgRemoveStrategy",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_MSG_REMOVE_STRATEGY,
+ &tny_camel_pop_remote_msg_remove_strategy_info);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelPopRemoteMsgRemoveStrategy",
- &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_MSG_REMOVE_STRATEGY,
- &tny_camel_pop_remote_msg_remove_strategy_info);
- }
-
- return type;
+GType
+tny_camel_pop_remote_msg_remove_strategy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_camel_pop_remote_msg_remove_strategy_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-full-msg-receive-strategy.c
===================================================================
--- libtinymail-camel/tny-camel-full-msg-receive-strategy.c (revision 3665)
+++ libtinymail-camel/tny-camel-full-msg-receive-strategy.c (working copy)
@@ -164,13 +164,11 @@
}
-GType
-tny_camel_full_msg_receive_strategy_get_type (void)
+static gpointer
+tny_camel_full_msg_receive_strategy_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+ static const GTypeInfo info =
{
sizeof (TnyCamelFullMsgReceiveStrategyClass),
NULL, /* base_init */
@@ -185,20 +183,27 @@
};
- static const GInterfaceInfo tny_msg_receive_strategy_info =
+ static const GInterfaceInfo tny_msg_receive_strategy_info =
{
(GInterfaceInitFunc) tny_msg_receive_strategy_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelFullMsgReceiveStrategy",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelFullMsgReceiveStrategy",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_MSG_RECEIVE_STRATEGY,
+ &tny_msg_receive_strategy_info);
+
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_MSG_RECEIVE_STRATEGY,
- &tny_msg_receive_strategy_info);
-
- }
- return type;
+GType
+tny_camel_full_msg_receive_strategy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_camel_full_msg_receive_strategy_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-send-queue.c
===================================================================
--- libtinymail-camel/tny-camel-send-queue.c (revision 3665)
+++ libtinymail-camel/tny-camel-send-queue.c (working copy)
@@ -1455,6 +1455,51 @@
klass->update= tny_camel_send_queue_update;
}
+static gpointer
+tny_camel_send_queue_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelSendQueueClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_send_queue_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelSendQueue),
+ 0, /* n_preallocs */
+ tny_camel_send_queue_instance_init, /* instance_init */
+ NULL
+ };
+
+ static const GInterfaceInfo tny_folder_observer_info = {
+ (GInterfaceInitFunc) tny_folder_observer_init,
+ NULL,
+ NULL
+ };
+
+ static const GInterfaceInfo tny_send_queue_info =
+ {
+ (GInterfaceInitFunc) tny_send_queue_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelSendQueue",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_FOLDER_OBSERVER,
+ &tny_folder_observer_info);
+
+ g_type_add_interface_static (type, TNY_TYPE_SEND_QUEUE,
+ &tny_send_queue_info);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_send_queue_get_type:
*
@@ -1465,7 +1510,7 @@
GType
tny_camel_send_queue_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -1475,46 +1520,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelSendQueueClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_send_queue_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelSendQueue),
- 0, /* n_preallocs */
- tny_camel_send_queue_instance_init, /* instance_init */
- NULL
- };
-
- static const GInterfaceInfo tny_folder_observer_info = {
- (GInterfaceInitFunc) tny_folder_observer_init,
- NULL,
- NULL
- };
-
- static const GInterfaceInfo tny_send_queue_info =
- {
- (GInterfaceInitFunc) tny_send_queue_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelSendQueue",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_FOLDER_OBSERVER,
- &tny_folder_observer_info);
-
- g_type_add_interface_static (type, TNY_TYPE_SEND_QUEUE,
- &tny_send_queue_info);
- }
-
- return type;
+ g_once (&once, tny_camel_send_queue_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-pop-store-account.c
===================================================================
--- libtinymail-camel/tny-camel-pop-store-account.c (revision 3665)
+++ libtinymail-camel/tny-camel-pop-store-account.c (working copy)
@@ -253,6 +253,31 @@
}
+static gpointer
+tny_camel_pop_store_account_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelPOPStoreAccountClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_pop_store_account_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelPOPStoreAccount),
+ 0, /* n_preallocs */
+ tny_camel_pop_store_account_instance_init /* instance_init */
+ };
+
+ type = g_type_register_static (TNY_TYPE_CAMEL_STORE_ACCOUNT,
+ "TnyCamelPOPStoreAccount",
+ &info, 0);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_pop_store_account_get_type:
*
@@ -263,7 +288,7 @@
GType
tny_camel_pop_store_account_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -274,26 +299,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelPOPStoreAccountClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_pop_store_account_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelPOPStoreAccount),
- 0, /* n_preallocs */
- tny_camel_pop_store_account_instance_init /* instance_init */
- };
-
- type = g_type_register_static (TNY_TYPE_CAMEL_STORE_ACCOUNT,
- "TnyCamelPOPStoreAccount",
- &info, 0);
- }
-
- return type;
+ g_once (&once, tny_camel_pop_store_account_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-msg.c
===================================================================
--- libtinymail-camel/tny-camel-msg.c (revision 3665)
+++ libtinymail-camel/tny-camel-msg.c (working copy)
@@ -401,6 +401,43 @@
return;
}
+static gpointer
+tny_camel_msg_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelMsgClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_msg_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelMsg),
+ 0, /* n_preallocs */
+ tny_camel_msg_instance_init, /* instance_init */
+ NULL
+ };
+
+ static const GInterfaceInfo tny_msg_info =
+ {
+ (GInterfaceInitFunc) tny_msg_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (TNY_TYPE_CAMEL_MIME_PART,
+ "TnyCamelMsg",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_MSG,
+ &tny_msg_info);
+
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_msg_get_type:
*
@@ -411,8 +448,8 @@
GType
tny_camel_msg_get_type (void)
{
- static GType type = 0;
-
+ static GOnce once = G_ONCE_INIT;
+
if (G_UNLIKELY (!_camel_type_init_done))
{
if (!g_thread_supported ())
@@ -422,38 +459,7 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelMsgClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_msg_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelMsg),
- 0, /* n_preallocs */
- tny_camel_msg_instance_init, /* instance_init */
- NULL
- };
-
- static const GInterfaceInfo tny_msg_info =
- {
- (GInterfaceInitFunc) tny_msg_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (TNY_TYPE_CAMEL_MIME_PART,
- "TnyCamelMsg",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_MSG,
- &tny_msg_info);
-
- }
-
- return type;
+ g_once (&once, tny_camel_msg_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-stream.c
===================================================================
--- libtinymail-camel/tny-camel-stream.c (revision 3665)
+++ libtinymail-camel/tny-camel-stream.c (working copy)
@@ -269,6 +269,52 @@
return;
}
+static gpointer
+tny_camel_stream_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelStreamClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_stream_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelStream),
+ 0, /* n_preallocs */
+ tny_camel_stream_instance_init /* instance_init */
+ };
+
+ static const GInterfaceInfo tny_stream_info =
+ {
+ (GInterfaceInitFunc) tny_stream_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ static const GInterfaceInfo tny_seekable_info =
+ {
+ (GInterfaceInitFunc) tny_seekable_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelStream",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_STREAM,
+ &tny_stream_info);
+
+ g_type_add_interface_static (type, TNY_TYPE_SEEKABLE,
+ &tny_seekable_info);
+
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_stream_get_type:
*
@@ -279,7 +325,7 @@
GType
tny_camel_stream_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -290,47 +336,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelStreamClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_stream_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelStream),
- 0, /* n_preallocs */
- tny_camel_stream_instance_init /* instance_init */
- };
-
- static const GInterfaceInfo tny_stream_info =
- {
- (GInterfaceInitFunc) tny_stream_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- static const GInterfaceInfo tny_seekable_info =
- {
- (GInterfaceInitFunc) tny_seekable_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelStream",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_STREAM,
- &tny_stream_info);
-
- g_type_add_interface_static (type, TNY_TYPE_SEEKABLE,
- &tny_seekable_info);
-
- }
-
- return type;
+ g_once (&once, tny_camel_stream_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-partial-msg-receive-strategy.c
===================================================================
--- libtinymail-camel/tny-camel-partial-msg-receive-strategy.c (revision 3665)
+++ libtinymail-camel/tny-camel-partial-msg-receive-strategy.c (working copy)
@@ -162,13 +162,11 @@
}
-GType
-tny_camel_partial_msg_receive_strategy_get_type (void)
+static gpointer
+tny_camel_partial_msg_receive_strategy_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+ static const GTypeInfo info =
{
sizeof (TnyCamelPartialMsgReceiveStrategyClass),
NULL, /* base_init */
@@ -183,20 +181,27 @@
};
- static const GInterfaceInfo tny_msg_receive_strategy_info =
+ static const GInterfaceInfo tny_msg_receive_strategy_info =
{
(GInterfaceInitFunc) tny_msg_receive_strategy_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelPartialMsgReceiveStrategy",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelPartialMsgReceiveStrategy",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_MSG_RECEIVE_STRATEGY,
+ &tny_msg_receive_strategy_info);
+
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_MSG_RECEIVE_STRATEGY,
- &tny_msg_receive_strategy_info);
-
- }
- return type;
+GType
+tny_camel_partial_msg_receive_strategy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_camel_partial_msg_receive_strategy_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-pop-folder.c
===================================================================
--- libtinymail-camel/tny-camel-pop-folder.c (revision 3665)
+++ libtinymail-camel/tny-camel-pop-folder.c (working copy)
@@ -122,6 +122,31 @@
return;
}
+static gpointer
+tny_camel_pop_folder_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelPOPFolderClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_pop_folder_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelPOPFolder),
+ 0, /* n_preallocs */
+ tny_camel_pop_folder_instance_init /* instance_init */
+ };
+
+ type = g_type_register_static (TNY_TYPE_CAMEL_FOLDER,
+ "TnyCamelPOPFolder",
+ &info, 0);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_pop_folder_get_type:
*
@@ -132,7 +157,7 @@
GType
tny_camel_pop_folder_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -143,26 +168,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelPOPFolderClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_pop_folder_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelPOPFolder),
- 0, /* n_preallocs */
- tny_camel_pop_folder_instance_init /* instance_init */
- };
-
- type = g_type_register_static (TNY_TYPE_CAMEL_FOLDER,
- "TnyCamelPOPFolder",
- &info, 0);
- }
-
- return type;
+ g_once (&once, tny_camel_pop_folder_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-imap-store-account.c
===================================================================
--- libtinymail-camel/tny-camel-imap-store-account.c (revision 3665)
+++ libtinymail-camel/tny-camel-imap-store-account.c (working copy)
@@ -167,6 +167,31 @@
return;
}
+static gpointer
+tny_camel_imap_store_account_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelIMAPStoreAccountClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_imap_store_account_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelIMAPStoreAccount),
+ 0, /* n_preallocs */
+ tny_camel_imap_store_account_instance_init /* instance_init */
+ };
+
+ type = g_type_register_static (TNY_TYPE_CAMEL_STORE_ACCOUNT,
+ "TnyCamelIMAPStoreAccount",
+ &info, 0);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_imap_store_account_get_type:
*
@@ -177,7 +202,7 @@
GType
tny_camel_imap_store_account_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -188,26 +213,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelIMAPStoreAccountClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_imap_store_account_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelIMAPStoreAccount),
- 0, /* n_preallocs */
- tny_camel_imap_store_account_instance_init /* instance_init */
- };
-
- type = g_type_register_static (TNY_TYPE_CAMEL_STORE_ACCOUNT,
- "TnyCamelIMAPStoreAccount",
- &info, 0);
- }
-
- return type;
+ g_once (&once, tny_camel_imap_store_account_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-msg-header.c
===================================================================
--- libtinymail-camel/tny-camel-msg-header.c (revision 3665)
+++ libtinymail-camel/tny-camel-msg-header.c (working copy)
@@ -626,6 +626,42 @@
}
+static gpointer
+tny_camel_msg_header_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelMsgHeaderClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_msg_header_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelMsgHeader),
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
+ };
+
+ static const GInterfaceInfo tny_header_info =
+ {
+ (GInterfaceInitFunc) tny_header_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelMsgHeader",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_HEADER,
+ &tny_header_info);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_msg_header_get_type:
*
@@ -636,7 +672,7 @@
GType
tny_camel_msg_header_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -647,36 +683,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelMsgHeaderClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_msg_header_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelMsgHeader),
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
- };
-
- static const GInterfaceInfo tny_header_info =
- {
- (GInterfaceInitFunc) tny_header_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelMsgHeader",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_HEADER,
- &tny_header_info);
- }
-
- return type;
+ g_once (&once, tny_camel_msg_header_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-bs-msg-header.c
===================================================================
--- libtinymail-camel/tny-camel-bs-msg-header.c (revision 3665)
+++ libtinymail-camel/tny-camel-bs-msg-header.c (working copy)
@@ -254,6 +254,42 @@
}
+static gpointer
+tny_camel_bs_msg_header_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelBsMsgHeaderClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_bs_msg_header_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelBsMsgHeader),
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
+ };
+
+ static const GInterfaceInfo tny_header_info =
+ {
+ (GInterfaceInitFunc) tny_header_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelBsMsgHeader",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_HEADER,
+ &tny_header_info);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_bs_msg_header_get_type:
*
@@ -264,7 +300,7 @@
GType
tny_camel_bs_msg_header_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -275,36 +311,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelBsMsgHeaderClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_bs_msg_header_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelBsMsgHeader),
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
- };
-
- static const GInterfaceInfo tny_header_info =
- {
- (GInterfaceInitFunc) tny_header_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelBsMsgHeader",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_HEADER,
- &tny_header_info);
- }
-
- return type;
+ g_once (&once, tny_camel_bs_msg_header_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-header.c
===================================================================
--- libtinymail-camel/tny-camel-header.c (revision 3665)
+++ libtinymail-camel/tny-camel-header.c (working copy)
@@ -401,6 +401,42 @@
return;
}
+static gpointer
+tny_camel_header_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelHeaderClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_header_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelHeader),
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
+ };
+
+ static const GInterfaceInfo tny_header_info =
+ {
+ (GInterfaceInitFunc) tny_header_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelHeader",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_HEADER,
+ &tny_header_info);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_header_get_type:
*
@@ -411,7 +447,7 @@
GType
tny_camel_header_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -422,36 +458,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelHeaderClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_header_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelHeader),
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
- };
-
- static const GInterfaceInfo tny_header_info =
- {
- (GInterfaceInitFunc) tny_header_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelHeader",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_HEADER,
- &tny_header_info);
- }
-
- return type;
+ g_once (&once, tny_camel_header_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-bs-mime-part.c
===================================================================
--- libtinymail-camel/tny-camel-bs-mime-part.c (revision 3665)
+++ libtinymail-camel/tny-camel-bs-mime-part.c (working copy)
@@ -1140,6 +1140,42 @@
return;
}
+static gpointer
+tny_camel_bs_mime_part_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelBsMimePartClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_bs_mime_part_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelBsMimePart),
+ 0, /* n_preallocs */
+ tny_camel_bs_mime_part_instance_init, /* instance_init */
+ NULL
+ };
+
+ static const GInterfaceInfo tny_mime_part_info =
+ {
+ (GInterfaceInitFunc) tny_mime_part_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelBsMimePart",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART,
+ &tny_mime_part_info);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_bs_mime_part_get_type:
*
@@ -1150,7 +1186,7 @@
GType
tny_camel_bs_mime_part_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -1161,36 +1197,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelBsMimePartClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_bs_mime_part_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelBsMimePart),
- 0, /* n_preallocs */
- tny_camel_bs_mime_part_instance_init, /* instance_init */
- NULL
- };
-
- static const GInterfaceInfo tny_mime_part_info =
- {
- (GInterfaceInitFunc) tny_mime_part_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelBsMimePart",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART,
- &tny_mime_part_info);
- }
-
- return type;
+ g_once (&once, tny_camel_bs_mime_part_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-imap-folder.c
===================================================================
--- libtinymail-camel/tny-camel-imap-folder.c (revision 3665)
+++ libtinymail-camel/tny-camel-imap-folder.c (working copy)
@@ -104,6 +104,31 @@
return;
}
+static gpointer
+tny_camel_imap_folder_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelIMAPFolderClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_imap_folder_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelIMAPFolder),
+ 0, /* n_preallocs */
+ tny_camel_imap_folder_instance_init /* instance_init */
+ };
+
+ type = g_type_register_static (TNY_TYPE_CAMEL_FOLDER,
+ "TnyCamelIMAPFolder",
+ &info, 0);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_imap_folder_get_type:
*
@@ -114,7 +139,7 @@
GType
tny_camel_imap_folder_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -124,27 +149,7 @@
camel_type_init ();
_camel_type_init_done = TRUE;
}
-
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelIMAPFolderClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_imap_folder_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelIMAPFolder),
- 0, /* n_preallocs */
- tny_camel_imap_folder_instance_init /* instance_init */
- };
-
- type = g_type_register_static (TNY_TYPE_CAMEL_FOLDER,
- "TnyCamelIMAPFolder",
- &info, 0);
- }
-
- return type;
+
+ g_once (&once, tny_camel_imap_folder_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-nntp-store-account.c
===================================================================
--- libtinymail-camel/tny-camel-nntp-store-account.c (revision 3665)
+++ libtinymail-camel/tny-camel-nntp-store-account.c (working copy)
@@ -173,6 +173,31 @@
return;
}
+static gpointer
+tny_camel_nntp_store_account_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelNNTPStoreAccountClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_nntp_store_account_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelNNTPStoreAccount),
+ 0, /* n_preallocs */
+ tny_camel_nntp_store_account_instance_init /* instance_init */
+ };
+
+ type = g_type_register_static (TNY_TYPE_CAMEL_STORE_ACCOUNT,
+ "TnyCamelNNTPStoreAccount",
+ &info, 0);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_nntp_store_account_get_type:
*
@@ -183,7 +208,7 @@
GType
tny_camel_nntp_store_account_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -194,26 +219,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelNNTPStoreAccountClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_nntp_store_account_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelNNTPStoreAccount),
- 0, /* n_preallocs */
- tny_camel_nntp_store_account_instance_init /* instance_init */
- };
-
- type = g_type_register_static (TNY_TYPE_CAMEL_STORE_ACCOUNT,
- "TnyCamelNNTPStoreAccount",
- &info, 0);
- }
-
- return type;
+ g_once (&once, tny_camel_nntp_store_account_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-mem-stream.c
===================================================================
--- libtinymail-camel/tny-camel-mem-stream.c (revision 3665)
+++ libtinymail-camel/tny-camel-mem-stream.c (working copy)
@@ -91,33 +91,37 @@
return;
}
-GType
-tny_camel_mem_stream_get_type (void)
+static gpointer
+tny_camel_mem_stream_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyCamelMemStreamClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_mem_stream_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelMemStream),
- 0, /* n_preallocs */
- tny_camel_mem_stream_instance_init, /* instance_init */
- NULL
+ sizeof (TnyCamelMemStreamClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_mem_stream_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelMemStream),
+ 0, /* n_preallocs */
+ tny_camel_mem_stream_instance_init, /* instance_init */
+ NULL
};
+
+
+ type = g_type_register_static (TNY_TYPE_CAMEL_STREAM,
+ "TnyCamelMemStream",
+ &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (TNY_TYPE_CAMEL_STREAM,
- "TnyCamelMemStream",
- &info, 0);
- }
-
- return type;
+GType
+tny_camel_mem_stream_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_camel_mem_stream_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-default-connection-policy.c
===================================================================
--- libtinymail-camel/tny-camel-default-connection-policy.c (revision 3665)
+++ libtinymail-camel/tny-camel-default-connection-policy.c (working copy)
@@ -77,13 +77,11 @@
return TNY_CONNECTION_POLICY (g_object_new (TNY_TYPE_CAMEL_DEFAULT_CONNECTION_POLICY, NULL));
}
-GType
-tny_camel_default_connection_policy_get_type (void)
+static gpointer
+tny_camel_default_connection_policy_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+ static const GTypeInfo info =
{
sizeof (TnyCamelDefaultConnectionPolicyClass),
NULL, /* base_init */
@@ -96,22 +94,29 @@
tny_camel_default_connection_policy_instance_init, /* instance_init */
NULL
};
-
-
- static const GInterfaceInfo tny_connection_policy_info =
+
+
+ static const GInterfaceInfo tny_connection_policy_info =
{
(GInterfaceInitFunc) tny_connection_policy_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelDefaultConnectionPolicy",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_CONNECTION_POLICY,
+ &tny_connection_policy_info);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelDefaultConnectionPolicy",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_CONNECTION_POLICY,
- &tny_connection_policy_info);
-
- }
- return type;
+GType
+tny_camel_default_connection_policy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_camel_default_connection_policy_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-camel/tny-camel-queue.c
===================================================================
--- libtinymail-camel/tny-camel-queue.c (revision 3665)
+++ libtinymail-camel/tny-camel-queue.c (working copy)
@@ -497,6 +497,32 @@
return;
}
+static gpointer
+tny_camel_queue_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelQueueClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_queue_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelQueue),
+ 0, /* n_preallocs */
+ tny_camel_queue_instance_init, /* instance_init */
+ NULL
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelQueue",
+ &info, 0);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_queue_get_type:
*
@@ -507,29 +533,7 @@
GType
tny_camel_queue_get_type (void)
{
- static GType type = 0;
-
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelQueueClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_queue_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelQueue),
- 0, /* n_preallocs */
- tny_camel_queue_instance_init, /* instance_init */
- NULL
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelQueue",
- &info, 0);
- }
-
- return type;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_camel_queue_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-store-account.c
===================================================================
--- libtinymail-camel/tny-camel-store-account.c (revision 3665)
+++ libtinymail-camel/tny-camel-store-account.c (working copy)
@@ -2108,6 +2108,52 @@
return;
}
+static gpointer
+tny_camel_store_account_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelStoreAccountClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_store_account_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelStoreAccount),
+ 0, /* n_preallocs */
+ tny_camel_store_account_instance_init /* instance_init */
+ };
+
+ static const GInterfaceInfo tny_store_account_info =
+ {
+ (GInterfaceInitFunc) tny_store_account_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ static const GInterfaceInfo tny_folder_store_info =
+ {
+ (GInterfaceInitFunc) tny_folder_store_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (TNY_TYPE_CAMEL_ACCOUNT,
+ "TnyCamelStoreAccount",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_FOLDER_STORE,
+ &tny_folder_store_info);
+
+ g_type_add_interface_static (type, TNY_TYPE_STORE_ACCOUNT,
+ &tny_store_account_info);
+
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_store_account_get_type:
*
@@ -2118,7 +2164,7 @@
GType
tny_camel_store_account_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -2129,47 +2175,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelStoreAccountClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_store_account_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelStoreAccount),
- 0, /* n_preallocs */
- tny_camel_store_account_instance_init /* instance_init */
- };
-
- static const GInterfaceInfo tny_store_account_info =
- {
- (GInterfaceInitFunc) tny_store_account_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- static const GInterfaceInfo tny_folder_store_info =
- {
- (GInterfaceInitFunc) tny_folder_store_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (TNY_TYPE_CAMEL_ACCOUNT,
- "TnyCamelStoreAccount",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_FOLDER_STORE,
- &tny_folder_store_info);
-
- g_type_add_interface_static (type, TNY_TYPE_STORE_ACCOUNT,
- &tny_store_account_info);
-
- }
-
- return type;
+ g_once (&once, tny_camel_store_account_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-transport-account.c
===================================================================
--- libtinymail-camel/tny-camel-transport-account.c (revision 3665)
+++ libtinymail-camel/tny-camel-transport-account.c (working copy)
@@ -373,6 +373,41 @@
return;
}
+static gpointer
+tny_camel_transport_account_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelTransportAccountClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_transport_account_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelTransportAccount),
+ 0, /* n_preallocs */
+ tny_camel_transport_account_instance_init /* instance_init */
+ };
+
+ static const GInterfaceInfo tny_transport_account_info =
+ {
+ (GInterfaceInitFunc) tny_transport_account_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (TNY_TYPE_CAMEL_ACCOUNT,
+ "TnyCamelTransportAccount",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_TRANSPORT_ACCOUNT,
+ &tny_transport_account_info);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_transport_account_get_type:
*
@@ -383,7 +418,7 @@
GType
tny_camel_transport_account_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -394,36 +429,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelTransportAccountClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_transport_account_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelTransportAccount),
- 0, /* n_preallocs */
- tny_camel_transport_account_instance_init /* instance_init */
- };
-
- static const GInterfaceInfo tny_transport_account_info =
- {
- (GInterfaceInitFunc) tny_transport_account_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (TNY_TYPE_CAMEL_ACCOUNT,
- "TnyCamelTransportAccount",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_TRANSPORT_ACCOUNT,
- &tny_transport_account_info);
- }
-
- return type;
+ g_once (&once, tny_camel_transport_account_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-bs-msg.c
===================================================================
--- libtinymail-camel/tny-camel-bs-msg.c (revision 3665)
+++ libtinymail-camel/tny-camel-bs-msg.c (working copy)
@@ -290,6 +290,42 @@
return;
}
+static gpointer
+tny_camel_bs_msg_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelBsMsgClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_bs_msg_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelBsMsg),
+ 0, /* n_preallocs */
+ tny_camel_bs_msg_instance_init, /* instance_init */
+ NULL
+ };
+
+ static const GInterfaceInfo tny_msg_info =
+ {
+ (GInterfaceInitFunc) tny_msg_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (TNY_TYPE_CAMEL_BS_MIME_PART,
+ "TnyCamelBsMsg",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_MSG,
+ &tny_msg_info);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_bs_msg_get_type:
*
@@ -300,7 +336,7 @@
GType
tny_camel_bs_msg_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -311,37 +347,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelBsMsgClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_bs_msg_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelBsMsg),
- 0, /* n_preallocs */
- tny_camel_bs_msg_instance_init, /* instance_init */
- NULL
- };
-
- static const GInterfaceInfo tny_msg_info =
- {
- (GInterfaceInitFunc) tny_msg_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (TNY_TYPE_CAMEL_BS_MIME_PART,
- "TnyCamelBsMsg",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_MSG,
- &tny_msg_info);
- }
-
- return type;
+ g_once (&once, tny_camel_bs_msg_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-camel/tny-camel-account.c
===================================================================
--- libtinymail-camel/tny-camel-account.c (revision 3665)
+++ libtinymail-camel/tny-camel-account.c (working copy)
@@ -2324,6 +2324,42 @@
return;
}
+static gpointer
+tny_camel_account_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyCamelAccountClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_camel_account_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyCamelAccount),
+ 0, /* n_preallocs */
+ tny_camel_account_instance_init /* instance_init */
+ };
+
+ static const GInterfaceInfo tny_account_info =
+ {
+ (GInterfaceInitFunc) tny_account_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCamelAccount",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_ACCOUNT,
+ &tny_account_info);
+
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_camel_account_get_type:
*
@@ -2334,7 +2370,7 @@
GType
tny_camel_account_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
if (G_UNLIKELY (!_camel_type_init_done))
{
@@ -2344,37 +2380,6 @@
_camel_type_init_done = TRUE;
}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyCamelAccountClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_camel_account_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyCamelAccount),
- 0, /* n_preallocs */
- tny_camel_account_instance_init /* instance_init */
- };
-
- static const GInterfaceInfo tny_account_info =
- {
- (GInterfaceInitFunc) tny_account_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCamelAccount",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_ACCOUNT,
- &tny_account_info);
-
- }
-
- return type;
+ g_once (&once, tny_camel_account_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymailui-gtk/tny-gtk-expander-mime-part-view.c
===================================================================
--- libtinymailui-gtk/tny-gtk-expander-mime-part-view.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-expander-mime-part-view.c (working copy)
@@ -224,14 +224,12 @@
return;
}
-GType
-tny_gtk_expander_mime_part_view_get_type (void)
+static gpointer
+tny_gtk_expander_mime_part_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkExpanderMimePartViewClass),
NULL, /* base_init */
@@ -245,21 +243,27 @@
NULL
};
- static const GInterfaceInfo tny_mime_part_view_info =
+ static const GInterfaceInfo tny_mime_part_view_info =
{
(GInterfaceInitFunc) tny_mime_part_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (GTK_TYPE_EXPANDER,
- "TnyGtkExpanderMimePartView",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_EXPANDER,
+ "TnyGtkExpanderMimePartView",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
- &tny_mime_part_view_info);
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
+ &tny_mime_part_view_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_gtk_expander_mime_part_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_expander_mime_part_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymailui-gtk/tny-gtk-attach-list-model.c
===================================================================
--- libtinymailui-gtk/tny-gtk-attach-list-model.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-attach-list-model.c (working copy)
@@ -361,22 +361,12 @@
return;
}
-
-/**
- * tny_gtk_attach_list_model_get_type:
- *
- * GType system helper function
- *
- * returns: a #GType
- **/
-GType
-tny_gtk_attach_list_model_get_type (void)
+static gpointer
+tny_gtk_attach_list_model_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkAttachListModelClass),
NULL, /* base_init */
@@ -391,45 +381,62 @@
};
- static const GInterfaceInfo tny_list_info = {
- (GInterfaceInitFunc) tny_list_init,
- NULL,
- NULL
- };
+ static const GInterfaceInfo tny_list_info = {
+ (GInterfaceInitFunc) tny_list_init,
+ NULL,
+ NULL
+ };
- type = g_type_register_static (GTK_TYPE_LIST_STORE, "TnyGtkAttachListModel",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_LIST_STORE, "TnyGtkAttachListModel",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_LIST,
- &tny_list_info);
+ g_type_add_interface_static (type, TNY_TYPE_LIST,
+ &tny_list_info);
-
- }
-
- return type;
+ return GUINT_TO_POINTER (type);
}
/**
- * tny_gtk_attach_list_model_column_get_type:
+ * tny_gtk_attach_list_model_get_type:
*
* GType system helper function
*
* returns: a #GType
**/
-GType
-tny_gtk_attach_list_model_column_get_type (void)
+GType
+tny_gtk_attach_list_model_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_attach_list_model_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
+
+static gpointer
+tny_gtk_attach_list_model_column_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
{ TNY_GTK_ATTACH_LIST_MODEL_PIXBUF_COLUMN, "TNY_GTK_ATTACH_LIST_MODEL_PIXBUF_COLUMN", "pixbuf" },
{ TNY_GTK_ATTACH_LIST_MODEL_FILENAME_COLUMN, "TNY_GTK_ATTACH_LIST_MODEL_FILENAME_COLUMN", "filename" },
{ TNY_GTK_ATTACH_LIST_MODEL_INSTANCE_COLUMN, "TNY_GTK_ATTACH_LIST_MODEL_INSTANCE_COLUMN", "instance" },
{ TNY_GTK_ATTACH_LIST_MODEL_N_COLUMNS, "TNY_GTK_ATTACH_LIST_MODEL_N_COLUMNS", "n" },
{ 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyGtkAttachListModelColumn", values);
- }
- return etype;
+ };
+ etype = g_enum_register_static ("TnyGtkAttachListModelColumn", values);
+ return GUINT_TO_POINTER (etype);
}
+/**
+ * tny_gtk_attach_list_model_column_get_type:
+ *
+ * GType system helper function
+ *
+ * returns: a #GType
+ **/
+GType
+tny_gtk_attach_list_model_column_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_attach_list_model_column_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtk/tny-gtk-image-mime-part-view.c
===================================================================
--- libtinymailui-gtk/tny-gtk-image-mime-part-view.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-image-mime-part-view.c (working copy)
@@ -228,14 +228,12 @@
return;
}
-GType
-tny_gtk_image_mime_part_view_get_type (void)
+static gpointer
+tny_gtk_image_mime_part_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkImageMimePartViewClass),
NULL, /* base_init */
@@ -249,21 +247,27 @@
NULL
};
- static const GInterfaceInfo tny_mime_part_view_info =
+ static const GInterfaceInfo tny_mime_part_view_info =
{
(GInterfaceInitFunc) tny_mime_part_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (GTK_TYPE_IMAGE,
- "TnyGtkImageMimePartView",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_IMAGE,
+ "TnyGtkImageMimePartView",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
- &tny_mime_part_view_info);
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
+ &tny_mime_part_view_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_gtk_image_mime_part_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_image_mime_part_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymailui-gtk/tny-gtk-text-buffer-stream.c
===================================================================
--- libtinymailui-gtk/tny-gtk-text-buffer-stream.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-text-buffer-stream.c (working copy)
@@ -363,14 +363,12 @@
return;
}
-GType
-tny_gtk_text_buffer_stream_get_type (void)
+static gpointer
+tny_gtk_text_buffer_stream_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkTextBufferStreamClass),
NULL, /* base_init */
@@ -383,20 +381,27 @@
tny_gtk_text_buffer_stream_instance_init /* instance_init */
};
- static const GInterfaceInfo tny_stream_info =
+ static const GInterfaceInfo tny_stream_info =
{
(GInterfaceInitFunc) tny_stream_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkTextBufferStream",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkTextBufferStream",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_STREAM,
- &tny_stream_info);
- }
+ g_type_add_interface_static (type, TNY_TYPE_STREAM,
+ &tny_stream_info);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+tny_gtk_text_buffer_stream_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_text_buffer_stream_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtk/tny-gtk-folder-store-tree-model-iterator.c
===================================================================
--- libtinymailui-gtk/tny-gtk-folder-store-tree-model-iterator.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-folder-store-tree-model-iterator.c (working copy)
@@ -229,14 +229,12 @@
return;
}
-GType
-_tny_gtk_folder_store_tree_model_iterator_get_type (void)
+static gpointer
+_tny_gtk_folder_store_tree_model_iterator_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkFolderStoreTreeModelIteratorClass),
NULL, /* base_init */
@@ -250,20 +248,27 @@
NULL
};
- static const GInterfaceInfo tny_iterator_info =
+ static const GInterfaceInfo tny_iterator_info =
{
(GInterfaceInitFunc) tny_iterator_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkFolderStoreTreeModelIterator",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkFolderStoreTreeModelIterator",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_ITERATOR,
- &tny_iterator_info);
- }
+ g_type_add_interface_static (type, TNY_TYPE_ITERATOR,
+ &tny_iterator_info);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+_tny_gtk_folder_store_tree_model_iterator_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, _tny_gtk_folder_store_tree_model_iterator_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtk/tny-gtk-header-list-iterator.c
===================================================================
--- libtinymailui-gtk/tny-gtk-header-list-iterator.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-header-list-iterator.c (working copy)
@@ -299,14 +299,12 @@
return;
}
-GType
-_tny_gtk_header_list_iterator_get_type (void)
+static gpointer
+_tny_gtk_header_list_iterator_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkHeaderListIteratorClass),
NULL, /* base_init */
@@ -320,20 +318,27 @@
NULL
};
- static const GInterfaceInfo tny_iterator_info =
+ static const GInterfaceInfo tny_iterator_info =
{
(GInterfaceInitFunc) tny_iterator_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkHeaderListIterator",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkHeaderListIterator",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_ITERATOR,
- &tny_iterator_info);
- }
+ g_type_add_interface_static (type, TNY_TYPE_ITERATOR,
+ &tny_iterator_info);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+_tny_gtk_header_list_iterator_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, _tny_gtk_header_list_iterator_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtk/tny-gtk-account-list-model-iterator.c
===================================================================
--- libtinymailui-gtk/tny-gtk-account-list-model-iterator.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-account-list-model-iterator.c (working copy)
@@ -230,14 +230,12 @@
return;
}
-GType
-_tny_gtk_account_list_model_iterator_get_type (void)
+static gpointer
+_tny_gtk_account_list_model_iterator_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkAccountListModelIteratorClass),
NULL, /* base_init */
@@ -250,20 +248,27 @@
tny_gtk_account_list_model_iterator_instance_init /* instance_init */
};
- static const GInterfaceInfo tny_iterator_info =
+ static const GInterfaceInfo tny_iterator_info =
{
(GInterfaceInitFunc) tny_iterator_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkAccountListModelIterator",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkAccountListModelIterator",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_ITERATOR,
- &tny_iterator_info);
- }
+ g_type_add_interface_static (type, TNY_TYPE_ITERATOR,
+ &tny_iterator_info);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+_tny_gtk_account_list_model_iterator_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, _tny_gtk_account_list_model_iterator_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtk/tny-gtk-header-view.c
===================================================================
--- libtinymailui-gtk/tny-gtk-header-view.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-header-view.c (working copy)
@@ -287,21 +287,12 @@
return;
}
-/**
- * tny_gtk_header_view_get_type:
- *
- * GType system helper function
- *
- * returns: a #GType
- **/
-GType
-tny_gtk_header_view_get_type (void)
+static gpointer
+tny_gtk_header_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkHeaderViewClass),
NULL, /* base_init */
@@ -314,21 +305,34 @@
tny_gtk_header_view_instance_init /* instance_init */
};
- static const GInterfaceInfo tny_header_view_info =
+ static const GInterfaceInfo tny_header_view_info =
{
(GInterfaceInitFunc) tny_header_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (GTK_TYPE_TABLE,
- "TnyGtkHeaderView",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_TABLE,
+ "TnyGtkHeaderView",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_HEADER_VIEW,
- &tny_header_view_info);
+ g_type_add_interface_static (type, TNY_TYPE_HEADER_VIEW,
+ &tny_header_view_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+/**
+ * tny_gtk_header_view_get_type:
+ *
+ * GType system helper function
+ *
+ * returns: a #GType
+ **/
+GType
+tny_gtk_header_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_header_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymailui-gtk/tny-gtk-account-list-model.c
===================================================================
--- libtinymailui-gtk/tny-gtk-account-list-model.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-account-list-model.c (working copy)
@@ -280,21 +280,12 @@
return;
}
-/**
- * tny_gtk_account_list_model_get_type:
- *
- * GType system helper function
- *
- * returns: a #GType
- **/
-GType
-tny_gtk_account_list_model_get_type (void)
+static gpointer
+tny_gtk_account_list_model_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkAccountListModelClass),
NULL, /* base_init */
@@ -308,22 +299,48 @@
NULL
};
- static const GInterfaceInfo tny_list_info = {
- (GInterfaceInitFunc) tny_list_init,
- NULL,
- NULL
- };
+ static const GInterfaceInfo tny_list_info = {
+ (GInterfaceInitFunc) tny_list_init,
+ NULL,
+ NULL
+ };
- type = g_type_register_static (GTK_TYPE_LIST_STORE, "TnyGtkAccountListModel",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_LIST_STORE, "TnyGtkAccountListModel",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_LIST,
- &tny_list_info);
+ g_type_add_interface_static (type, TNY_TYPE_LIST,
+ &tny_list_info);
+ return GUINT_TO_POINTER (type);
+}
- }
+/**
+ * tny_gtk_account_list_model_get_type:
+ *
+ * GType system helper function
+ *
+ * returns: a #GType
+ **/
+GType
+tny_gtk_account_list_model_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_account_list_model_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
- return type;
+static gpointer
+tny_gtk_account_list_model_column_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_GTK_ACCOUNT_LIST_MODEL_NAME_COLUMN, "TNY_GTK_ACCOUNT_LIST_MODEL_NAME_COLUMN", "name" },
+ { TNY_GTK_ACCOUNT_LIST_MODEL_INSTANCE_COLUMN, "TNY_GTK_ACCOUNT_LIST_MODEL_INSTANCE_COLUMN", "instance" },
+ { TNY_GTK_ACCOUNT_LIST_MODEL_N_COLUMNS, "TNY_GTK_ACCOUNT_LIST_MODEL_N_COLUMNS", "n" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnyGtkAccountListModelColumn", values);
+ return GUINT_TO_POINTER (etype);
}
/**
@@ -336,16 +353,7 @@
GType
tny_gtk_account_list_model_column_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_GTK_ACCOUNT_LIST_MODEL_NAME_COLUMN, "TNY_GTK_ACCOUNT_LIST_MODEL_NAME_COLUMN", "name" },
- { TNY_GTK_ACCOUNT_LIST_MODEL_INSTANCE_COLUMN, "TNY_GTK_ACCOUNT_LIST_MODEL_INSTANCE_COLUMN", "instance" },
- { TNY_GTK_ACCOUNT_LIST_MODEL_N_COLUMNS, "TNY_GTK_ACCOUNT_LIST_MODEL_N_COLUMNS", "n" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyGtkAccountListModelColumn", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_account_list_model_column_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymailui-gtk/tny-gtk-lockable.c
===================================================================
--- libtinymailui-gtk/tny-gtk-lockable.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-lockable.c (working copy)
@@ -93,13 +93,11 @@
}
-GType
-tny_gtk_lockable_get_type (void)
+static gpointer
+tny_gtk_lockable_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+ static const GTypeInfo info =
{
sizeof (TnyGtkLockableClass),
NULL, /* base_init */
@@ -114,20 +112,27 @@
};
- static const GInterfaceInfo tny_lockable_info =
+ static const GInterfaceInfo tny_lockable_info =
{
(GInterfaceInitFunc) tny_lockable_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkLockable",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkLockable",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_LOCKABLE,
- &tny_lockable_info);
+ g_type_add_interface_static (type, TNY_TYPE_LOCKABLE,
+ &tny_lockable_info);
- }
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+tny_gtk_lockable_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_lockable_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtk/tny-gtk-text-mime-part-view.c
===================================================================
--- libtinymailui-gtk/tny-gtk-text-mime-part-view.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-text-mime-part-view.c (working copy)
@@ -219,14 +219,12 @@
return;
}
-GType
-tny_gtk_text_mime_part_view_get_type (void)
+static gpointer
+tny_gtk_text_mime_part_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkTextMimePartViewClass),
NULL, /* base_init */
@@ -240,21 +238,27 @@
NULL
};
- static const GInterfaceInfo tny_mime_part_view_info =
+ static const GInterfaceInfo tny_mime_part_view_info =
{
(GInterfaceInitFunc) tny_mime_part_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (GTK_TYPE_TEXT_VIEW,
- "TnyGtkTextMimePartView",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_TEXT_VIEW,
+ "TnyGtkTextMimePartView",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
- &tny_mime_part_view_info);
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
+ &tny_mime_part_view_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_gtk_text_mime_part_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_text_mime_part_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymailui-gtk/tny-gtk-pixbuf-stream.c
===================================================================
--- libtinymailui-gtk/tny-gtk-pixbuf-stream.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-pixbuf-stream.c (working copy)
@@ -280,14 +280,12 @@
return;
}
-GType
-tny_gtk_pixbuf_stream_get_type (void)
+static gpointer
+tny_gtk_pixbuf_stream_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkPixbufStreamClass),
NULL, /* base_init */
@@ -300,20 +298,27 @@
tny_gtk_pixbuf_stream_instance_init /* instance_init */
};
- static const GInterfaceInfo tny_stream_info =
+ static const GInterfaceInfo tny_stream_info =
{
(GInterfaceInitFunc) tny_stream_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkPixbufStream",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkPixbufStream",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_STREAM,
- &tny_stream_info);
- }
+ g_type_add_interface_static (type, TNY_TYPE_STREAM,
+ &tny_stream_info);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+tny_gtk_pixbuf_stream_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_pixbuf_stream_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtk/tny-gtk-mime-part-save-strategy.c
===================================================================
--- libtinymailui-gtk/tny-gtk-mime-part-save-strategy.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-mime-part-save-strategy.c (working copy)
@@ -261,14 +261,12 @@
return;
}
-GType
-tny_gtk_mime_part_save_strategy_get_type (void)
+static gpointer
+tny_gtk_mime_part_save_strategy_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkMimePartSaveStrategyClass),
NULL, /* base_init */
@@ -282,21 +280,27 @@
NULL
};
- static const GInterfaceInfo tny_gtk_mime_part_save_strategy_info =
+ static const GInterfaceInfo tny_gtk_mime_part_save_strategy_info =
{
(GInterfaceInitFunc) tny_gtk_mime_part_save_strategy_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkMimePartSaveStrategy",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkMimePartSaveStrategy",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART_SAVE_STRATEGY,
- &tny_gtk_mime_part_save_strategy_info);
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART_SAVE_STRATEGY,
+ &tny_gtk_mime_part_save_strategy_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_gtk_mime_part_save_strategy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_mime_part_save_strategy_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymailui-gtk/tny-gtk-attachment-mime-part-view.c
===================================================================
--- libtinymailui-gtk/tny-gtk-attachment-mime-part-view.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-attachment-mime-part-view.c (working copy)
@@ -209,21 +209,12 @@
return;
}
-/**
- * tny_gtk_attachment_mime_part_view_get_type:
- *
- * GType system helper function
- *
- * returns: a #GType
- **/
-GType
-tny_gtk_attachment_mime_part_view_get_type (void)
+static gpointer
+tny_gtk_attachment_mime_part_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkAttachmentMimePartViewClass),
NULL, /* base_init */
@@ -237,21 +228,34 @@
NULL
};
- static const GInterfaceInfo tny_mime_part_view_info =
+ static const GInterfaceInfo tny_mime_part_view_info =
{
(GInterfaceInitFunc) tny_mime_part_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkAttachmentMimePartView",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkAttachmentMimePartView",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
- &tny_mime_part_view_info);
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
+ &tny_mime_part_view_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+/**
+ * tny_gtk_attachment_mime_part_view_get_type:
+ *
+ * GType system helper function
+ *
+ * returns: a #GType
+ **/
+GType
+tny_gtk_attachment_mime_part_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_attachment_mime_part_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymailui-gtk/tny-gtk-msg-window.c
===================================================================
--- libtinymailui-gtk/tny-gtk-msg-window.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-msg-window.c (working copy)
@@ -353,14 +353,12 @@
return;
}
-GType
-tny_gtk_msg_window_get_type (void)
+static gpointer
+tny_gtk_msg_window_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkMsgWindowClass),
NULL, /* base_init */
@@ -374,41 +372,47 @@
NULL
};
- static const GInterfaceInfo tny_msg_window_info =
+ static const GInterfaceInfo tny_msg_window_info =
{
(GInterfaceInitFunc) tny_msg_window_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- static const GInterfaceInfo tny_msg_view_info =
+ static const GInterfaceInfo tny_msg_view_info =
{
(GInterfaceInitFunc) tny_msg_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- static const GInterfaceInfo tny_mime_part_view_info =
+ static const GInterfaceInfo tny_mime_part_view_info =
{
(GInterfaceInitFunc) tny_mime_part_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (GTK_TYPE_WINDOW,
- "TnyGtkMsgWindow",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_WINDOW,
+ "TnyGtkMsgWindow",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
- &tny_mime_part_view_info);
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
+ &tny_mime_part_view_info);
- g_type_add_interface_static (type, TNY_TYPE_MSG_VIEW,
- &tny_msg_view_info);
+ g_type_add_interface_static (type, TNY_TYPE_MSG_VIEW,
+ &tny_msg_view_info);
- g_type_add_interface_static (type, TNY_TYPE_MSG_WINDOW,
- &tny_msg_window_info);
+ g_type_add_interface_static (type, TNY_TYPE_MSG_WINDOW,
+ &tny_msg_window_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_gtk_msg_window_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_msg_window_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymailui-gtk/tny-gtk-msg-view.c
===================================================================
--- libtinymailui-gtk/tny-gtk-msg-view.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-msg-view.c (working copy)
@@ -963,21 +963,12 @@
return;
}
-/**
- * tny_gtk_msg_view_get_type:
- *
- * GType system helper function
- *
- * returns: a #GType
- **/
-GType
-tny_gtk_msg_view_get_type (void)
+static gpointer
+tny_gtk_msg_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkMsgViewClass),
NULL, /* base_init */
@@ -991,30 +982,44 @@
NULL
};
- static const GInterfaceInfo tny_msg_view_info =
+ static const GInterfaceInfo tny_msg_view_info =
{
(GInterfaceInitFunc) tny_msg_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- static const GInterfaceInfo tny_mime_part_view_info =
+ static const GInterfaceInfo tny_mime_part_view_info =
{
(GInterfaceInitFunc) tny_mime_part_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (GTK_TYPE_BIN,
- "TnyGtkMsgView",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_BIN,
+ "TnyGtkMsgView",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
- &tny_mime_part_view_info);
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
+ &tny_mime_part_view_info);
- g_type_add_interface_static (type, TNY_TYPE_MSG_VIEW,
- &tny_msg_view_info);
- }
+ g_type_add_interface_static (type, TNY_TYPE_MSG_VIEW,
+ &tny_msg_view_info);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+/**
+ * tny_gtk_msg_view_get_type:
+ *
+ * GType system helper function
+ *
+ * returns: a #GType
+ **/
+GType
+tny_gtk_msg_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_msg_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtk/tny-gtk-header-list-model.c
===================================================================
--- libtinymailui-gtk/tny-gtk-header-list-model.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-header-list-model.c (working copy)
@@ -1334,21 +1334,12 @@
return GTK_TREE_MODEL (model);
}
-/**
- * tny_gtk_header_list_model_get_type:
- *
- * GType system helper function
- *
- * returns: a #GType
- **/
-GType
-tny_gtk_header_list_model_get_type (void)
+static gpointer
+tny_gtk_header_list_model_register_type (gpointer notused)
{
- static GType object_type = 0;
+ GType object_type = 0;
- if (G_UNLIKELY(object_type == 0))
- {
- static const GTypeInfo object_info =
+ static const GTypeInfo object_info =
{
sizeof (TnyGtkHeaderListModelClass),
NULL, /* base_init */
@@ -1362,47 +1353,52 @@
NULL
};
- static const GInterfaceInfo tree_model_info = {
- (GInterfaceInitFunc) tny_gtk_header_list_model_tree_model_init,
- NULL,
- NULL
- };
+ static const GInterfaceInfo tree_model_info = {
+ (GInterfaceInitFunc) tny_gtk_header_list_model_tree_model_init,
+ NULL,
+ NULL
+ };
- static const GInterfaceInfo tny_list_info = {
- (GInterfaceInitFunc) tny_list_init,
- NULL,
- NULL
- };
+ static const GInterfaceInfo tny_list_info = {
+ (GInterfaceInitFunc) tny_list_init,
+ NULL,
+ NULL
+ };
- object_type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkHeaderListModel", &object_info, 0);
+ object_type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkHeaderListModel", &object_info, 0);
- g_type_add_interface_static (object_type, GTK_TYPE_TREE_MODEL,
- &tree_model_info);
+ g_type_add_interface_static (object_type, GTK_TYPE_TREE_MODEL,
+ &tree_model_info);
- g_type_add_interface_static (object_type, TNY_TYPE_LIST,
- &tny_list_info);
+ g_type_add_interface_static (object_type, TNY_TYPE_LIST,
+ &tny_list_info);
- }
-
- return object_type;
+ return GUINT_TO_POINTER (object_type);
}
/**
- * tny_gtk_header_list_model_column_get_type:
+ * tny_gtk_header_list_model_get_type:
*
* GType system helper function
*
* returns: a #GType
**/
GType
-tny_gtk_header_list_model_column_get_type (void)
+tny_gtk_header_list_model_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_header_list_model_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
+static gpointer
+tny_gtk_header_list_model_column_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+
{ TNY_GTK_HEADER_LIST_MODEL_FROM_COLUMN, "TNY_GTK_HEADER_LIST_MODEL_FROM_COLUMN", "from" },
{ TNY_GTK_HEADER_LIST_MODEL_TO_COLUMN, "TNY_GTK_HEADER_LIST_MODEL_TO_COLUMN", "to" },
{ TNY_GTK_HEADER_LIST_MODEL_SUBJECT_COLUMN, "TNY_GTK_HEADER_LIST_MODEL_SUBJECT_COLUMN", "subject" },
@@ -1416,9 +1412,22 @@
{ TNY_GTK_HEADER_LIST_MODEL_FLAGS_COLUMN, "TNY_GTK_HEADER_LIST_MODEL_FLAGS_COLUMN", "flags" },
{ TNY_GTK_HEADER_LIST_MODEL_N_COLUMNS, "TNY_GTK_HEADER_LIST_MODEL_N_COLUMNS", "n" },
{ 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyGtkHeaderListModelColumn", values);
- }
- return etype;
+ };
+ etype = g_enum_register_static ("TnyGtkHeaderListModelColumn", values);
+ return GUINT_TO_POINTER (etype);
}
+/**
+ * tny_gtk_header_list_model_column_get_type:
+ *
+ * GType system helper function
+ *
+ * returns: a #GType
+ **/
+GType
+tny_gtk_header_list_model_column_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_header_list_model_column_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtk/tny-gtk-password-dialog.c
===================================================================
--- libtinymailui-gtk/tny-gtk-password-dialog.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-password-dialog.c (working copy)
@@ -177,14 +177,12 @@
return;
}
-GType
-tny_gtk_password_dialog_get_type (void)
+static gpointer
+tny_gtk_password_dialog_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkPasswordDialogClass),
NULL, /* base_init */
@@ -197,19 +195,26 @@
tny_gtk_password_dialog_instance_init /* instance_init */
};
- static const GInterfaceInfo tny_password_getter_info =
+ static const GInterfaceInfo tny_password_getter_info =
{
(GInterfaceInitFunc) tny_password_getter_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkPasswordDialog", &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkPasswordDialog", &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_PASSWORD_GETTER,
+ &tny_password_getter_info);
- g_type_add_interface_static (type, TNY_TYPE_PASSWORD_GETTER,
- &tny_password_getter_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_gtk_password_dialog_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_password_dialog_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymailui-gtk/tny-gtk-folder-store-tree-model.c
===================================================================
--- libtinymailui-gtk/tny-gtk-folder-store-tree-model.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-folder-store-tree-model.c (working copy)
@@ -1162,21 +1162,12 @@
return;
}
-/**
- * tny_gtk_folder_store_tree_model_get_type:
- *
- * GType system helper function
- *
- * returns: a #GType
- **/
-GType
-tny_gtk_folder_store_tree_model_get_type (void)
+static gpointer
+tny_gtk_folder_store_tree_model_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkFolderStoreTreeModelClass),
NULL, /* base_init */
@@ -1189,53 +1180,57 @@
tny_gtk_folder_store_tree_model_instance_init /* instance_init */
};
- static const GInterfaceInfo tny_list_info = {
- (GInterfaceInitFunc) tny_list_init,
- NULL,
- NULL
- };
+ static const GInterfaceInfo tny_list_info = {
+ (GInterfaceInitFunc) tny_list_init,
+ NULL,
+ NULL
+ };
- static const GInterfaceInfo tny_folder_store_observer_info = {
- (GInterfaceInitFunc) tny_folder_store_observer_init,
- NULL,
- NULL
- };
+ static const GInterfaceInfo tny_folder_store_observer_info = {
+ (GInterfaceInitFunc) tny_folder_store_observer_init,
+ NULL,
+ NULL
+ };
- static const GInterfaceInfo tny_folder_observer_info = {
- (GInterfaceInitFunc) tny_folder_observer_init,
- NULL,
- NULL
- };
+ static const GInterfaceInfo tny_folder_observer_info = {
+ (GInterfaceInitFunc) tny_folder_observer_init,
+ NULL,
+ NULL
+ };
- type = g_type_register_static (GTK_TYPE_TREE_STORE, "TnyGtkFolderStoreTreeModel",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_TREE_STORE, "TnyGtkFolderStoreTreeModel",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_LIST,
- &tny_list_info);
- g_type_add_interface_static (type, TNY_TYPE_FOLDER_STORE_OBSERVER,
- &tny_folder_store_observer_info);
- g_type_add_interface_static (type, TNY_TYPE_FOLDER_OBSERVER,
- &tny_folder_observer_info);
+ g_type_add_interface_static (type, TNY_TYPE_LIST,
+ &tny_list_info);
+ g_type_add_interface_static (type, TNY_TYPE_FOLDER_STORE_OBSERVER,
+ &tny_folder_store_observer_info);
+ g_type_add_interface_static (type, TNY_TYPE_FOLDER_OBSERVER,
+ &tny_folder_observer_info);
- }
-
- return type;
+ return GUINT_TO_POINTER (type);
}
-
/**
- * tny_gtk_folder_store_tree_model_column_get_type:
+ * tny_gtk_folder_store_tree_model_get_type:
*
* GType system helper function
*
* returns: a #GType
**/
GType
-tny_gtk_folder_store_tree_model_column_get_type (void)
+tny_gtk_folder_store_tree_model_get_type (void)
{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_folder_store_tree_model_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
+
+static gpointer
+tny_gtk_folder_store_tree_model_column_register_type (gpointer notused)
+{
static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
+ static const GEnumValue values[] = {
{ TNY_GTK_FOLDER_STORE_TREE_MODEL_NAME_COLUMN, "TNY_GTK_FOLDER_STORE_TREE_MODEL_NAME_COLUMN", "name" },
{ TNY_GTK_FOLDER_STORE_TREE_MODEL_UNREAD_COLUMN, "TNY_GTK_FOLDER_STORE_TREE_MODEL_UNREAD_COLUMN", "unread" },
{ TNY_GTK_FOLDER_STORE_TREE_MODEL_ALL_COLUMN, "TNY_GTK_FOLDER_STORE_TREE_MODEL_ALL_COLUMN", "all" },
@@ -1243,9 +1238,22 @@
{ TNY_GTK_FOLDER_STORE_TREE_MODEL_INSTANCE_COLUMN, "TNY_GTK_FOLDER_STORE_TREE_MODEL_INSTANCE_COLUMN", "instance" },
{ TNY_GTK_FOLDER_STORE_TREE_MODEL_N_COLUMNS, "TNY_GTK_FOLDER_STORE_TREE_MODEL_N_COLUMNS", "n" },
{ 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyGtkFolderStoreTreeModelColumn", values);
- }
- return etype;
+ };
+ etype = g_enum_register_static ("TnyGtkFolderStoreTreeModelColumn", values);
+ return GUINT_TO_POINTER (etype);
}
+/**
+ * tny_gtk_folder_store_tree_model_column_get_type:
+ *
+ * GType system helper function
+ *
+ * returns: a #GType
+ **/
+GType
+tny_gtk_folder_store_tree_model_column_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_folder_store_tree_model_column_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtk/tny-gtk-attach-list-model-iterator.c
===================================================================
--- libtinymailui-gtk/tny-gtk-attach-list-model-iterator.c (revision 3665)
+++ libtinymailui-gtk/tny-gtk-attach-list-model-iterator.c (working copy)
@@ -231,14 +231,12 @@
return;
}
-GType
-_tny_gtk_attach_list_model_iterator_get_type (void)
+static gpointer
+_tny_gtk_attach_list_model_iterator_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkAttachListModelIteratorClass),
NULL, /* base_init */
@@ -251,20 +249,27 @@
tny_gtk_attach_list_model_iterator_instance_init /* instance_init */
};
- static const GInterfaceInfo tny_iterator_info =
+ static const GInterfaceInfo tny_iterator_info =
{
(GInterfaceInitFunc) tny_iterator_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkAttachListModelIterator",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkAttachListModelIterator",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_ITERATOR,
- &tny_iterator_info);
- }
+ g_type_add_interface_static (type, TNY_TYPE_ITERATOR,
+ &tny_iterator_info);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+_tny_gtk_attach_list_model_iterator_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, _tny_gtk_attach_list_model_iterator_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymail-tp/tny-tp-mail-notifier.c
===================================================================
--- libtinymail-tp/tny-tp-mail-notifier.c (revision 3665)
+++ libtinymail-tp/tny-tp-mail-notifier.c (working copy)
@@ -90,14 +90,12 @@
return self;
}
-GType
-tny_tp_mail_notifier_get_type (void)
+static gpointer
+tny_tp_mail_notifier_register_type (gpointer notused)
{
- static GType object_type = 0;
+ GType object_type = 0;
- if (G_UNLIKELY(object_type == 0))
- {
- static const GTypeInfo object_info =
+ static const GTypeInfo object_info =
{
sizeof (TnyTpMailNotifierClass),
NULL, /* base_init */
@@ -111,9 +109,16 @@
NULL
};
- object_type = g_type_register_static (G_TYPE_OBJECT,
- "TnyTpMailNotifier", &object_info, 0);
- }
+ object_type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyTpMailNotifier", &object_info, 0);
- return object_type;
+ return GUINT_TO_POINTER (object_type);
}
+
+GType
+tny_tp_mail_notifier_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_tp_mail_notifier_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymail-maemo/tny-maemo-device.c
===================================================================
--- libtinymail-maemo/tny-maemo-device.c (revision 3665)
+++ libtinymail-maemo/tny-maemo-device.c (working copy)
@@ -196,42 +196,45 @@
return;
}
-GType
-tny_maemo_device_get_type (void)
+static gpointer
+tny_maemo_device_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyMaemoDeviceClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_maemo_device_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyMaemoDevice),
- 0, /* n_preallocs */
- tny_maemo_device_instance_init /* instance_init */
+ sizeof (TnyMaemoDeviceClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_maemo_device_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyMaemoDevice),
+ 0, /* n_preallocs */
+ tny_maemo_device_instance_init /* instance_init */
};
-
- static const GInterfaceInfo tny_device_info =
+
+ static const GInterfaceInfo tny_device_info =
{
- (GInterfaceInitFunc) tny_device_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_device_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyMaemoDevice",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_DEVICE,
+ &tny_device_info);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyMaemoDevice",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_DEVICE,
- &tny_device_info);
-
- }
-
- return type;
+GType
+tny_maemo_device_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_maemo_device_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail-maemo/tny-maemo-conic-dummy-device.c
===================================================================
--- libtinymail-maemo/tny-maemo-conic-dummy-device.c (revision 3665)
+++ libtinymail-maemo/tny-maemo-conic-dummy-device.c (working copy)
@@ -610,42 +610,47 @@
g_type_class_add_private (object_class, sizeof (TnyMaemoConicDevicePriv));
}
-GType
-tny_maemo_conic_device_get_type (void)
+static gpointer
+tny_maemo_conic_device_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyMaemoConicDeviceClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_maemo_conic_device_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyMaemoConicDevice),
- 0, /* n_preallocs */
- tny_maemo_conic_device_instance_init /* instance_init */
+ sizeof (TnyMaemoConicDeviceClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_maemo_conic_device_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyMaemoConicDevice),
+ 0, /* n_preallocs */
+ tny_maemo_conic_device_instance_init /* instance_init */
};
-
- static const GInterfaceInfo tny_device_info =
+
+ static const GInterfaceInfo tny_device_info =
{
- (GInterfaceInitFunc) tny_device_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_device_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyMaemoConicDevice",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_DEVICE,
+ &tny_device_info);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyMaemoConicDevice",
- &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_DEVICE,
- &tny_device_info);
-
- }
- return type;
+GType
+tny_maemo_conic_device_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_maemo_conic_device_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
static gboolean
Index: libtinymail-maemo/tny-maemo-noconic-device.c
===================================================================
--- libtinymail-maemo/tny-maemo-noconic-device.c (revision 3665)
+++ libtinymail-maemo/tny-maemo-noconic-device.c (working copy)
@@ -158,45 +158,49 @@
g_type_class_add_private (object_class, sizeof (TnyMaemoConicDevicePriv));
}
-GType
-tny_maemo_conic_device_get_type (void)
+static gpointer
+tny_maemo_conic_device_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyMaemoConicDeviceClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_maemo_conic_device_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyMaemoConicDevice),
- 0, /* n_preallocs */
- tny_maemo_conic_device_instance_init /* instance_init */
+ sizeof (TnyMaemoConicDeviceClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_maemo_conic_device_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyMaemoConicDevice),
+ 0, /* n_preallocs */
+ tny_maemo_conic_device_instance_init /* instance_init */
};
-
- static const GInterfaceInfo tny_device_info =
+
+ static const GInterfaceInfo tny_device_info =
{
- (GInterfaceInitFunc) tny_device_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_device_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyMaemoConicDevice",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_DEVICE,
+ &tny_device_info);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyMaemoConicDevice",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_DEVICE,
- &tny_device_info);
-
- }
- return type;
+GType
+tny_maemo_conic_device_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_maemo_conic_device_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
gboolean
tny_maemo_conic_device_connect (TnyMaemoConicDevice *self,
const gchar* iap_id,
Index: libtinymail-maemo/tny-maemo-account-store.c
===================================================================
--- libtinymail-maemo/tny-maemo-account-store.c (revision 3665)
+++ libtinymail-maemo/tny-maemo-account-store.c (working copy)
@@ -560,40 +560,45 @@
}
-GType
-tny_maemo_account_store_get_type (void)
+static gpointer
+tny_maemo_account_store_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyMaemoAccountStoreClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_maemo_account_store_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyMaemoAccountStore),
- 0, /* n_preallocs */
- tny_maemo_account_store_instance_init /* instance_init */
+ sizeof (TnyMaemoAccountStoreClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_maemo_account_store_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyMaemoAccountStore),
+ 0, /* n_preallocs */
+ tny_maemo_account_store_instance_init /* instance_init */
};
-
- static const GInterfaceInfo tny_account_store_info =
+
+ static const GInterfaceInfo tny_account_store_info =
{
- (GInterfaceInitFunc) tny_account_store_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_account_store_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyMaemoAccountStore",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_ACCOUNT_STORE,
+ &tny_account_store_info);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyMaemoAccountStore",
- &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_ACCOUNT_STORE,
- &tny_account_store_info);
- }
-
- return type;
+GType
+tny_maemo_account_store_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_maemo_account_store_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-maemo/tny-maemo-conic-device.c
===================================================================
--- libtinymail-maemo/tny-maemo-conic-device.c (revision 3665)
+++ libtinymail-maemo/tny-maemo-conic-device.c (working copy)
@@ -726,44 +726,48 @@
g_type_class_add_private (object_class, sizeof (TnyMaemoConicDevicePriv));
}
-GType
-tny_maemo_conic_device_get_type (void)
+static gpointer
+tny_maemo_conic_device_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyMaemoConicDeviceClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_maemo_conic_device_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyMaemoConicDevice),
- 0, /* n_preallocs */
- tny_maemo_conic_device_instance_init /* instance_init */
+ sizeof (TnyMaemoConicDeviceClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_maemo_conic_device_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyMaemoConicDevice),
+ 0, /* n_preallocs */
+ tny_maemo_conic_device_instance_init /* instance_init */
};
- static const GInterfaceInfo tny_device_info =
+ static const GInterfaceInfo tny_device_info =
{
- (GInterfaceInitFunc) tny_device_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_device_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyMaemoConicDevice",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_DEVICE,
+ &tny_device_info);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyMaemoConicDevice",
- &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_DEVICE,
- &tny_device_info);
-
- }
- return type;
+GType
+tny_maemo_conic_device_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_maemo_conic_device_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
static void
stop_loop (TnyMaemoConicDevice *self)
{
Index: libtinymail-maemo/tny-maemo-platform-factory.c
===================================================================
--- libtinymail-maemo/tny-maemo-platform-factory.c (revision 3665)
+++ libtinymail-maemo/tny-maemo-platform-factory.c (working copy)
@@ -157,41 +157,45 @@
return;
}
-GType
-tny_maemo_platform_factory_get_type (void)
+static gpointer
+tny_maemo_platform_factory_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyMaemoPlatformFactoryClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_maemo_platform_factory_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyMaemoPlatformFactory),
- 0, /* n_preallocs */
- tny_maemo_platform_factory_instance_init /* instance_init */
+ sizeof (TnyMaemoPlatformFactoryClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_maemo_platform_factory_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyMaemoPlatformFactory),
+ 0, /* n_preallocs */
+ tny_maemo_platform_factory_instance_init /* instance_init */
};
-
- static const GInterfaceInfo tny_platform_factory_info =
+
+ static const GInterfaceInfo tny_platform_factory_info =
{
- (GInterfaceInitFunc) tny_platform_factory_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_platform_factory_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyMaemoPlatformFactory",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_PLATFORM_FACTORY,
+ &tny_platform_factory_info);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyMaemoPlatformFactory",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_PLATFORM_FACTORY,
- &tny_platform_factory_info);
-
- }
-
- return type;
+GType
+tny_maemo_platform_factory_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_maemo_platform_factory_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymailui-mozembed/tny-moz-embed-stream.c
===================================================================
--- libtinymailui-mozembed/tny-moz-embed-stream.c (revision 3665)
+++ libtinymailui-mozembed/tny-moz-embed-stream.c (working copy)
@@ -329,14 +329,12 @@
return;
}
-GType
-tny_moz_embed_stream_get_type (void)
+static gpointer
+tny_moz_embed_stream_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyMozEmbedStreamClass),
NULL, /* base_init */
@@ -349,20 +347,27 @@
tny_moz_embed_stream_instance_init /* instance_init */
};
- static const GInterfaceInfo tny_stream_info =
+ static const GInterfaceInfo tny_stream_info =
{
(GInterfaceInitFunc) tny_stream_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyMozEmbedStream",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyMozEmbedStream",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_STREAM,
- &tny_stream_info);
- }
+ g_type_add_interface_static (type, TNY_TYPE_STREAM,
+ &tny_stream_info);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+tny_moz_embed_stream_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_moz_embed_stream_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-mozembed/tny-moz-embed-msg-view.c
===================================================================
--- libtinymailui-mozembed/tny-moz-embed-msg-view.c (revision 3665)
+++ libtinymailui-mozembed/tny-moz-embed-msg-view.c (working copy)
@@ -148,14 +148,12 @@
return;
}
-GType
-tny_moz_embed_msg_view_get_type (void)
+static gpointer
+tny_moz_embed_msg_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyMozEmbedMsgViewClass),
NULL, /* base_init */
@@ -168,10 +166,17 @@
tny_moz_embed_msg_view_instance_init /* instance_init */
};
- type = g_type_register_static (TNY_TYPE_GTK_MSG_VIEW,
- "TnyMozEmbedMsgView",
- &info, 0);
- }
+ type = g_type_register_static (TNY_TYPE_GTK_MSG_VIEW,
+ "TnyMozEmbedMsgView",
+ &info, 0);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+tny_moz_embed_msg_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_moz_embed_msg_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-mozembed/tny-moz-embed-html-mime-part-view.c
===================================================================
--- libtinymailui-mozembed/tny-moz-embed-html-mime-part-view.c (revision 3665)
+++ libtinymailui-mozembed/tny-moz-embed-html-mime-part-view.c (working copy)
@@ -217,14 +217,12 @@
return;
}
-GType
-tny_moz_embed_html_mime_part_view_get_type (void)
+static gpointer
+tny_moz_embed_html_mime_part_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyMozEmbedHtmlMimePartViewClass),
NULL, /* base_init */
@@ -238,21 +236,27 @@
NULL
};
- static const GInterfaceInfo tny_mime_part_view_info =
+ static const GInterfaceInfo tny_mime_part_view_info =
{
(GInterfaceInitFunc) tny_mime_part_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (GTK_TYPE_MOZ_EMBED,
- "TnyMozEmbedHtmlMimePartView",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_MOZ_EMBED,
+ "TnyMozEmbedHtmlMimePartView",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
+ &tny_mime_part_view_info);
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
- &tny_mime_part_view_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_moz_embed_html_mime_part_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_moz_embed_html_mime_part_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c
===================================================================
--- libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c (revision 3665)
+++ libtinymailui-gtkhtml/tny-gtk-html-mime-part-view.c (working copy)
@@ -317,14 +317,12 @@
return;
}
-GType
-tny_gtk_html_mime_part_view_get_type (void)
+static gpointer
+tny_gtk_html_mime_part_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkHtmlMimePartViewClass),
NULL, /* base_init */
@@ -338,21 +336,27 @@
NULL
};
- static const GInterfaceInfo tny_mime_part_view_info =
+ static const GInterfaceInfo tny_mime_part_view_info =
{
(GInterfaceInitFunc) tny_mime_part_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (GTK_TYPE_HTML,
- "TnyGtkHtmlMimePartView",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_HTML,
+ "TnyGtkHtmlMimePartView",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
- &tny_mime_part_view_info);
- }
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
+ &tny_mime_part_view_info);
- return type;
+ return GUINT_TO_POINTER (type);
}
+GType
+tny_gtk_html_mime_part_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_html_mime_part_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtkhtml/tny-gtk-html-stream.c
===================================================================
--- libtinymailui-gtkhtml/tny-gtk-html-stream.c (revision 3665)
+++ libtinymailui-gtkhtml/tny-gtk-html-stream.c (working copy)
@@ -199,14 +199,12 @@
return;
}
-GType
-tny_gtk_html_stream_get_type (void)
+static gpointer
+tny_gtk_html_stream_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkHtmlStreamClass),
NULL, /* base_init */
@@ -219,20 +217,27 @@
tny_gtk_html_stream_instance_init /* instance_init */
};
- static const GInterfaceInfo tny_stream_info =
+ static const GInterfaceInfo tny_stream_info =
{
(GInterfaceInitFunc) tny_stream_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGtkHtmlStream",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGtkHtmlStream",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_STREAM,
- &tny_stream_info);
- }
+ g_type_add_interface_static (type, TNY_TYPE_STREAM,
+ &tny_stream_info);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+tny_gtk_html_stream_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_html_stream_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gtkhtml/tny-gtk-html-msg-view.c
===================================================================
--- libtinymailui-gtkhtml/tny-gtk-html-msg-view.c (revision 3665)
+++ libtinymailui-gtkhtml/tny-gtk-html-msg-view.c (working copy)
@@ -140,14 +140,12 @@
return;
}
-GType
-tny_gtk_html_msg_view_get_type (void)
+static gpointer
+tny_gtk_html_msg_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyGtkHtmlMsgViewClass),
NULL, /* base_init */
@@ -160,11 +158,17 @@
tny_gtk_html_msg_view_instance_init /* instance_init */
};
- type = g_type_register_static (TNY_TYPE_GTK_MSG_VIEW,
- "TnyGtkHtmlMsgView",
- &info, 0);
- }
+ type = g_type_register_static (TNY_TYPE_GTK_MSG_VIEW,
+ "TnyGtkHtmlMsgView",
+ &info, 0);
- return type;
+ return GUINT_TO_POINTER (type);
}
+GType
+tny_gtk_html_msg_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gtk_html_msg_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui-gnome-keyring/tny-gnome-keyring-password-getter.c
===================================================================
--- libtinymailui-gnome-keyring/tny-gnome-keyring-password-getter.c (revision 3665)
+++ libtinymailui-gnome-keyring/tny-gnome-keyring-password-getter.c (working copy)
@@ -171,13 +171,11 @@
return TNY_PASSWORD_GETTER (self);
}
-GType
-tny_gnome_keyring_password_getter_get_type (void)
+static gpointer
+tny_gnome_keyring_password_getter_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+ static const GTypeInfo info =
{
sizeof (TnyGnomeKeyringPasswordGetterClass),
NULL, /* base_init */
@@ -192,20 +190,27 @@
};
- static const GInterfaceInfo tny_password_getter_info =
+ static const GInterfaceInfo tny_password_getter_info =
{
(GInterfaceInitFunc) tny_password_getter_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGnomeKeyringPasswordGetter",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGnomeKeyringPasswordGetter",
+ &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_PASSWORD_GETTER,
- &tny_password_getter_info);
+ g_type_add_interface_static (type, TNY_TYPE_PASSWORD_GETTER,
+ &tny_password_getter_info);
- }
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+tny_gnome_keyring_password_getter_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gnome_keyring_password_getter_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymail-gnome-desktop/tny-gnome-account-store.c
===================================================================
--- libtinymail-gnome-desktop/tny-gnome-account-store.c (revision 3665)
+++ libtinymail-gnome-desktop/tny-gnome-account-store.c (working copy)
@@ -556,6 +556,41 @@
return;
}
+static gpointer
+tny_gnome_account_store_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyGnomeAccountStoreClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_gnome_account_store_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyGnomeAccountStore),
+ 0, /* n_preallocs */
+ tny_gnome_account_store_instance_init /* instance_init */
+ };
+
+ static const GInterfaceInfo tny_account_store_info =
+ {
+ (GInterfaceInitFunc) tny_account_store_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGnomeAccountStore",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_ACCOUNT_STORE,
+ &tny_account_store_info);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_gnome_account_store_get_type:
*
@@ -566,37 +601,7 @@
GType
tny_gnome_account_store_get_type (void)
{
- static GType type = 0;
-
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyGnomeAccountStoreClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_gnome_account_store_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyGnomeAccountStore),
- 0, /* n_preallocs */
- tny_gnome_account_store_instance_init /* instance_init */
- };
-
- static const GInterfaceInfo tny_account_store_info =
- {
- (GInterfaceInitFunc) tny_account_store_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGnomeAccountStore",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_ACCOUNT_STORE,
- &tny_account_store_info);
- }
-
- return type;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gnome_account_store_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-gnome-desktop/tny-gnome-platform-factory.c
===================================================================
--- libtinymail-gnome-desktop/tny-gnome-platform-factory.c (revision 3665)
+++ libtinymail-gnome-desktop/tny-gnome-platform-factory.c (working copy)
@@ -191,41 +191,46 @@
return;
}
-GType
-tny_gnome_platform_factory_get_type (void)
+static gpointer
+tny_gnome_platform_factory_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyGnomePlatformFactoryClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_gnome_platform_factory_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyGnomePlatformFactory),
- 0, /* n_preallocs */
- tny_gnome_platform_factory_instance_init /* instance_init */
+ sizeof (TnyGnomePlatformFactoryClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_gnome_platform_factory_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyGnomePlatformFactory),
+ 0, /* n_preallocs */
+ tny_gnome_platform_factory_instance_init /* instance_init */
};
-
- static const GInterfaceInfo tny_platform_factory_info =
+
+ static const GInterfaceInfo tny_platform_factory_info =
{
- (GInterfaceInitFunc) tny_platform_factory_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_platform_factory_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGnomePlatformFactory",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_PLATFORM_FACTORY,
+ &tny_platform_factory_info);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGnomePlatformFactory",
- &info, 0);
- g_type_add_interface_static (type, TNY_TYPE_PLATFORM_FACTORY,
- &tny_platform_factory_info);
+ return GUINT_TO_POINTER (type);
+}
- }
-
- return type;
+GType
+tny_gnome_platform_factory_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gnome_platform_factory_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail-gnome-desktop/tny-gnome-device.c
===================================================================
--- libtinymail-gnome-desktop/tny-gnome-device.c (revision 3665)
+++ libtinymail-gnome-desktop/tny-gnome-device.c (working copy)
@@ -296,42 +296,46 @@
return;
}
-GType
-tny_gnome_device_get_type (void)
+static gpointer
+tny_gnome_device_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyGnomeDeviceClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_gnome_device_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyGnomeDevice),
- 0, /* n_preallocs */
- tny_gnome_device_instance_init /* instance_init */
+ sizeof (TnyGnomeDeviceClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_gnome_device_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyGnomeDevice),
+ 0, /* n_preallocs */
+ tny_gnome_device_instance_init /* instance_init */
};
-
- static const GInterfaceInfo tny_device_info =
+
+ static const GInterfaceInfo tny_device_info =
{
- (GInterfaceInitFunc) tny_device_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_device_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyGnomeDevice",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_DEVICE,
+ &tny_device_info);
+
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyGnomeDevice",
- &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_DEVICE,
- &tny_device_info);
-
- }
-
- return type;
+GType
+tny_gnome_device_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_gnome_device_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: ChangeLog
===================================================================
--- ChangeLog (revision 3665)
+++ ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2008-05-14 Jose Dapena Paz <jdapena igalia com>
+
+ * Use GOnce registering all types in tinymail to make
+ registering thread-safe.
+
2008-05-14 Philip Van Hoof <pvanhoof gnome org>
* libtinymail-camel/tny-camel-queue.c: Letting the thread wait for
Index: libtinymailui-webkit/tny-webkit-html-mime-part-view.c
===================================================================
--- libtinymailui-webkit/tny-webkit-html-mime-part-view.c (revision 3665)
+++ libtinymailui-webkit/tny-webkit-html-mime-part-view.c (working copy)
@@ -172,14 +172,12 @@
return;
}
-GType
-tny_webkit_html_mime_part_view_get_type (void)
+static gpointer
+tny_webkit_html_mime_part_view_get_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyWebkitHtmlMimePartViewClass),
NULL, /* base_init */
@@ -193,21 +191,27 @@
NULL
};
- static const GInterfaceInfo tny_mime_part_view_info =
+ static const GInterfaceInfo tny_mime_part_view_info =
{
(GInterfaceInitFunc) tny_mime_part_view_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (GTK_TYPE_WEBKIT,
- "TnyWebkitHtmlMimePartView",
- &info, 0);
+ type = g_type_register_static (GTK_TYPE_WEBKIT,
+ "TnyWebkitHtmlMimePartView",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
+ &tny_mime_part_view_info);
- g_type_add_interface_static (type, TNY_TYPE_MIME_PART_VIEW,
- &tny_mime_part_view_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_webkit_html_mime_part_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_webkit_html_mime_part_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymailui-webkit/tny-webkit-stream.c
===================================================================
--- libtinymailui-webkit/tny-webkit-stream.c (revision 3665)
+++ libtinymailui-webkit/tny-webkit-stream.c (working copy)
@@ -191,14 +191,12 @@
return;
}
-GType
-tny_webkit_stream_get_type (void)
+static gpointer
+tny_webkit_stream_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyWebkitStreamClass),
NULL, /* base_init */
@@ -211,20 +209,27 @@
tny_webkit_stream_instance_init /* instance_init */
};
- static const GInterfaceInfo tny_stream_info =
+ static const GInterfaceInfo tny_stream_info =
{
(GInterfaceInitFunc) tny_stream_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyWebkitStream",
- &info, 0);
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyWebkitStream",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_STREAM,
+ &tny_stream_info);
- g_type_add_interface_static (type, TNY_TYPE_STREAM,
- &tny_stream_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_webkit_stream_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_webkit_stream_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymailui-webkit/tny-webkit-msg-view.c
===================================================================
--- libtinymailui-webkit/tny-webkit-msg-view.c (revision 3665)
+++ libtinymailui-webkit/tny-webkit-msg-view.c (working copy)
@@ -138,14 +138,12 @@
return;
}
-GType
-tny_webkit_msg_view_get_type (void)
+static gpointer
+tny_webkit_msg_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyWebkitMsgViewClass),
NULL, /* base_init */
@@ -158,10 +156,17 @@
tny_webkit_msg_view_instance_init /* instance_init */
};
- type = g_type_register_static (TNY_TYPE_GTK_MSG_VIEW,
- "TnyWebkitMsgView",
- &info, 0);
- }
+ type = g_type_register_static (TNY_TYPE_GTK_MSG_VIEW,
+ "TnyWebkitMsgView",
+ &info, 0);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+tny_webkit_msg_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_webkit_msg_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymail-gnomevfs/tny-vfs-stream.c
===================================================================
--- libtinymail-gnomevfs/tny-vfs-stream.c (revision 3665)
+++ libtinymail-gnomevfs/tny-vfs-stream.c (working copy)
@@ -456,52 +456,56 @@
return;
}
-GType
-tny_vfs_stream_get_type (void)
+static gpointer
+tny_vfs_stream_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyVfsStreamClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_vfs_stream_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyVfsStream),
- 0, /* n_preallocs */
- tny_vfs_stream_instance_init,/* instance_init */
- NULL
+ sizeof (TnyVfsStreamClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_vfs_stream_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyVfsStream),
+ 0, /* n_preallocs */
+ tny_vfs_stream_instance_init,/* instance_init */
+ NULL
};
-
- static const GInterfaceInfo tny_stream_info =
+
+ static const GInterfaceInfo tny_stream_info =
{
- (GInterfaceInitFunc) tny_stream_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_stream_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
-
- static const GInterfaceInfo tny_seekable_info =
+
+ static const GInterfaceInfo tny_seekable_info =
{
- (GInterfaceInitFunc) tny_seekable_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_seekable_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyVfsStream",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_STREAM,
+ &tny_stream_info);
+
+ g_type_add_interface_static (type, TNY_TYPE_SEEKABLE,
+ &tny_seekable_info);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyVfsStream",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_STREAM,
- &tny_stream_info);
-
- g_type_add_interface_static (type, TNY_TYPE_SEEKABLE,
- &tny_seekable_info);
-
- }
-
- return type;
+GType
+tny_vfs_stream_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_vfs_stream_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymailui/tny-mime-part-save-strategy.c
===================================================================
--- libtinymailui/tny-mime-part-save-strategy.c (revision 3665)
+++ libtinymailui/tny-mime-part-save-strategy.c (working copy)
@@ -117,14 +117,12 @@
initialized = TRUE;
}
-GType
-tny_mime_part_save_strategy_get_type (void)
+static gpointer
+tny_mime_part_save_strategy_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyMimePartSaveStrategyIface),
tny_mime_part_save_strategy_base_init, /* base_init */
@@ -136,11 +134,18 @@
0, /* n_preallocs */
NULL /* instance_init */
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyMimePartSaveStrategy", &info, 0);
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyMimePartSaveStrategy", &info, 0);
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- }
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+tny_mime_part_save_strategy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_mime_part_save_strategy_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui/tny-platform-factory.c
===================================================================
--- libtinymailui/tny-platform-factory.c (revision 3665)
+++ libtinymailui/tny-platform-factory.c (working copy)
@@ -187,14 +187,12 @@
initialized = TRUE;
}
-GType
-tny_platform_factory_get_type (void)
+static gpointer
+tny_platform_factory_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyPlatformFactoryIface),
tny_platform_factory_base_init, /* base_init */
@@ -206,11 +204,18 @@
0, /* n_preallocs */
NULL /* instance_init */
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyPlatformFactory", &info, 0);
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyPlatformFactory", &info, 0);
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- }
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+tny_platform_factory_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_platform_factory_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui/tny-msg-window.c
===================================================================
--- libtinymailui/tny-msg-window.c (revision 3665)
+++ libtinymailui/tny-msg-window.c (working copy)
@@ -41,14 +41,12 @@
}
}
-GType
-tny_msg_window_get_type (void)
+static gpointer
+tny_msg_window_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyMsgWindowIface),
tny_msg_window_base_init, /* base_init */
@@ -61,13 +59,18 @@
NULL /* instance_init */
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyMsgWindow", &info, 0);
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyMsgWindow", &info, 0);
- g_type_interface_add_prerequisite (type, TNY_TYPE_MSG_VIEW);
- }
+ g_type_interface_add_prerequisite (type, TNY_TYPE_MSG_VIEW);
- return type;
+ return GUINT_TO_POINTER (type);
}
-
+GType
+tny_msg_window_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_msg_window_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui/tny-account-store-view.c
===================================================================
--- libtinymailui/tny-account-store-view.c (revision 3665)
+++ libtinymailui/tny-account-store-view.c (working copy)
@@ -65,14 +65,12 @@
}
}
-GType
-tny_account_store_view_get_type (void)
+static gpointer
+tny_account_store_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyAccountStoreViewIface),
tny_account_store_view_base_init, /* base_init */
@@ -84,13 +82,18 @@
0, /* n_preallocs */
NULL /* instance_init */
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyAccountStoreView", &info, 0);
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyAccountStoreView", &info, 0);
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- }
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- return type;
+ return GUINT_TO_POINTER (type);
}
-
+GType
+tny_account_store_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_account_store_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui/tny-msg-view.c
===================================================================
--- libtinymailui/tny-msg-view.c (revision 3665)
+++ libtinymailui/tny-msg-view.c (working copy)
@@ -250,14 +250,12 @@
}
}
-GType
-tny_msg_view_get_type (void)
+static gpointer
+tny_msg_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyMsgViewIface),
tny_msg_view_base_init, /* base_init */
@@ -269,14 +267,18 @@
0, /* n_preallocs */
NULL /* instance_init */
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyMsgView", &info, 0);
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyMsgView", &info, 0);
- g_type_interface_add_prerequisite (type, TNY_TYPE_MIME_PART_VIEW);
+ g_type_interface_add_prerequisite (type, TNY_TYPE_MIME_PART_VIEW);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_msg_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_msg_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
-
Index: libtinymailui/tny-header-view.c
===================================================================
--- libtinymailui/tny-header-view.c (revision 3665)
+++ libtinymailui/tny-header-view.c (working copy)
@@ -89,14 +89,12 @@
}
}
-GType
-tny_header_view_get_type (void)
+static gpointer
+tny_header_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyHeaderViewIface),
tny_header_view_base_init, /* base_init */
@@ -108,13 +106,18 @@
0, /* n_preallocs */
NULL /* instance_init */
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyHeaderView", &info, 0);
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyHeaderView", &info, 0);
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- }
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- return type;
+ return GUINT_TO_POINTER (type);
}
-
+GType
+tny_header_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_header_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui/tny-mime-part-view.c
===================================================================
--- libtinymailui/tny-mime-part-view.c (revision 3665)
+++ libtinymailui/tny-mime-part-view.c (working copy)
@@ -176,14 +176,12 @@
}
}
-GType
-tny_mime_part_view_get_type (void)
+static gpointer
+tny_mime_part_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyMimePartViewIface),
tny_mime_part_view_base_init, /* base_init */
@@ -195,11 +193,16 @@
0, /* n_preallocs */
NULL /* instance_init */
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyMimePartView", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyMimePartView", &info, 0);
- return type;
+ return GUINT_TO_POINTER (type);
}
-
+GType
+tny_mime_part_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_mime_part_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui/tny-summary-view.c
===================================================================
--- libtinymailui/tny-summary-view.c (revision 3665)
+++ libtinymailui/tny-summary-view.c (working copy)
@@ -33,14 +33,12 @@
}
}
-GType
-tny_summary_view_get_type (void)
+static gpointer
+tny_summary_view_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnySummaryViewIface),
tny_summary_view_base_init, /* base_init */
@@ -52,13 +50,18 @@
0, /* n_preallocs */
NULL /* instance_init */
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnySummaryView", &info, 0);
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnySummaryView", &info, 0);
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- }
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- return type;
+ return GUINT_TO_POINTER (type);
}
-
+GType
+tny_summary_view_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_summary_view_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymailui/tny-mime-part-saver.c
===================================================================
--- libtinymailui/tny-mime-part-saver.c (revision 3665)
+++ libtinymailui/tny-mime-part-saver.c (working copy)
@@ -151,14 +151,12 @@
}
}
-GType
-tny_mime_part_saver_get_type (void)
+static gpointer
+tny_mime_part_saver_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
sizeof (TnyMimePartSaverIface),
tny_mime_part_saver_base_init, /* base_init */
@@ -170,10 +168,16 @@
0, /* n_preallocs */
NULL /* instance_init */
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyMimePartSaver", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyMimePartSaver", &info, 0);
- return type;
+ return GUINT_TO_POINTER (type);
}
+GType
+tny_mime_part_saver_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_mime_part_saver_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymail/tny-password-getter.c
===================================================================
--- libtinymail/tny-password-getter.c (revision 3665)
+++ libtinymail/tny-password-getter.c (working copy)
@@ -102,29 +102,34 @@
}
}
-GType
-tny_password_getter_get_type (void)
+static gpointer
+tny_password_getter_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyPasswordGetterIface),
- tny_password_getter_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyPasswordGetterIface),
+ tny_password_getter_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyPasswordGetter", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyPasswordGetter", &info, 0);
- return type;
+ return GUINT_TO_POINTER (type);
}
+
+GType
+tny_password_getter_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_password_getter_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymail/tny-stream.c
===================================================================
--- libtinymail/tny-stream.c (revision 3665)
+++ libtinymail/tny-stream.c (working copy)
@@ -200,31 +200,34 @@
}
}
-GType
-tny_stream_get_type (void)
+static gpointer
+tny_stream_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyStreamIface),
- tny_stream_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyStreamIface),
+ tny_stream_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyStream", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyStream", &info, 0);
+
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_stream_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_stream_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
-
Index: libtinymail/tny-pair.c
===================================================================
--- libtinymail/tny-pair.c (revision 3665)
+++ libtinymail/tny-pair.c (working copy)
@@ -184,32 +184,35 @@
return;
}
-GType
-tny_pair_get_type (void)
+static gpointer
+tny_pair_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyPairClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_pair_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyPair),
- 0, /* n_preallocs */
- tny_pair_instance_init, /* instance_init */
- NULL
+ sizeof (TnyPairClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_pair_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyPair),
+ 0, /* n_preallocs */
+ tny_pair_instance_init, /* instance_init */
+ NULL
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyPair",
+ &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyPair",
- &info, 0);
- }
-
- return type;
+GType
+tny_pair_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_pair_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail/tny-folder-change.c
===================================================================
--- libtinymail/tny-folder-change.c (revision 3665)
+++ libtinymail/tny-folder-change.c (working copy)
@@ -593,36 +593,56 @@
return;
}
-GType
-tny_folder_change_get_type (void)
+static gpointer
+tny_folder_change_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyFolderChangeClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_folder_change_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyFolderChange),
- 0, /* n_preallocs */
- tny_folder_change_instance_init, /* instance_init */
- NULL
+ sizeof (TnyFolderChangeClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_folder_change_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyFolderChange),
+ 0, /* n_preallocs */
+ tny_folder_change_instance_init, /* instance_init */
+ NULL
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyFolderChange",
+ &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyFolderChange",
- &info, 0);
- }
+GType
+tny_folder_change_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_change_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
- return type;
+static gpointer
+tny_folder_change_changed_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GFlagsValue values[] = {
+ { TNY_FOLDER_CHANGE_CHANGED_ALL_COUNT, "TNY_FOLDER_CHANGE_CHANGED_ALL_COUNT", "all-count" },
+ { TNY_FOLDER_CHANGE_CHANGED_UNREAD_COUNT, "TNY_FOLDER_CHANGE_CHANGED_UNREAD_COUNT", "unread-count" },
+ { TNY_FOLDER_CHANGE_CHANGED_ADDED_HEADERS, "TNY_FOLDER_CHANGE_CHANGED_ADDED_HEADERS","added-headers" },
+ { TNY_FOLDER_CHANGE_CHANGED_EXPUNGED_HEADERS, "TNY_FOLDER_CHANGE_CHANGED_EXPUNGED_HEADERS", "expunged-headers" },
+ { TNY_FOLDER_CHANGE_CHANGED_FOLDER_RENAME, "TNY_FOLDER_CHANGE_CHANGED_FOLDER_RENAME", "rename" },
+ { TNY_FOLDER_CHANGE_CHANGED_MSG_RECEIVED, "TNY_FOLDER_CHANGE_CHANGED_MSG_RECEIVED", "received" },
+ { 0, NULL, NULL }
+ };
+ etype = g_flags_register_static ("TnyFolderChangeChanged", values);
+ return GUINT_TO_POINTER (etype);
}
-
/**
* tny_folder_change_changed_get_type:
*
@@ -633,19 +653,7 @@
GType
tny_folder_change_changed_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GFlagsValue values[] = {
- { TNY_FOLDER_CHANGE_CHANGED_ALL_COUNT, "TNY_FOLDER_CHANGE_CHANGED_ALL_COUNT", "all-count" },
- { TNY_FOLDER_CHANGE_CHANGED_UNREAD_COUNT, "TNY_FOLDER_CHANGE_CHANGED_UNREAD_COUNT", "unread-count" },
- { TNY_FOLDER_CHANGE_CHANGED_ADDED_HEADERS, "TNY_FOLDER_CHANGE_CHANGED_ADDED_HEADERS","added-headers" },
- { TNY_FOLDER_CHANGE_CHANGED_EXPUNGED_HEADERS, "TNY_FOLDER_CHANGE_CHANGED_EXPUNGED_HEADERS", "expunged-headers" },
- { TNY_FOLDER_CHANGE_CHANGED_FOLDER_RENAME, "TNY_FOLDER_CHANGE_CHANGED_FOLDER_RENAME", "rename" },
- { TNY_FOLDER_CHANGE_CHANGED_MSG_RECEIVED, "TNY_FOLDER_CHANGE_CHANGED_MSG_RECEIVED", "received" },
- { 0, NULL, NULL }
- };
- etype = g_flags_register_static ("TnyFolderChangeChanged", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_change_changed_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail/tny-folder-observer.c
===================================================================
--- libtinymail/tny-folder-observer.c (revision 3665)
+++ libtinymail/tny-folder-observer.c (working copy)
@@ -72,30 +72,33 @@
}
}
-GType
-tny_folder_observer_get_type (void)
+static gpointer
+tny_folder_observer_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyFolderObserverIface),
- tny_folder_observer_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyFolderObserverIface),
+ tny_folder_observer_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyFolderObserver", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyFolderObserver", &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_folder_observer_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_observer_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail/tny-folder-monitor.c
===================================================================
--- libtinymail/tny-folder-monitor.c (revision 3665)
+++ libtinymail/tny-folder-monitor.c (working copy)
@@ -424,13 +424,12 @@
g_type_class_add_private (object_class, sizeof (TnyFolderMonitorPriv));
}
-GType
-tny_folder_monitor_get_type (void)
+static gpointer
+tny_folder_monitor_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+
+ static const GTypeInfo info =
{
sizeof (TnyFolderMonitorClass),
NULL, /* base_init */
@@ -442,23 +441,29 @@
0, /* n_preallocs */
tny_folder_monitor_instance_init, /* instance_init */
NULL
- };
-
-
- static const GInterfaceInfo tny_folder_observer_info =
+ };
+
+ static const GInterfaceInfo tny_folder_observer_info =
{
(GInterfaceInitFunc) tny_folder_observer_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyFolderMonitor",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_FOLDER_OBSERVER,
+ &tny_folder_observer_info);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyFolderMonitor",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_FOLDER_OBSERVER,
- &tny_folder_observer_info);
-
- }
- return type;
+GType
+tny_folder_monitor_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_monitor_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-msg-receive-strategy.c
===================================================================
--- libtinymail/tny-msg-receive-strategy.c (revision 3665)
+++ libtinymail/tny-msg-receive-strategy.c (working copy)
@@ -84,28 +84,32 @@
initialized = TRUE;
}
-GType
-tny_msg_receive_strategy_get_type (void)
+static gpointer
+tny_msg_receive_strategy_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyMsgReceiveStrategyIface),
- tny_msg_receive_strategy_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL /* instance_init */
+ sizeof (TnyMsgReceiveStrategyIface),
+ tny_msg_receive_strategy_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL /* instance_init */
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyMsgReceiveStrategy", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyMsgReceiveStrategy", &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_msg_receive_strategy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_msg_receive_strategy_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-folder-stats.c
===================================================================
--- libtinymail/tny-folder-stats.c (revision 3665)
+++ libtinymail/tny-folder-stats.c (working copy)
@@ -205,32 +205,35 @@
return;
}
-GType
-tny_folder_stats_get_type (void)
+static gpointer
+tny_folder_stats_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyFolderStatsClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_folder_stats_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyFolderStats),
- 0, /* n_preallocs */
- tny_folder_stats_instance_init, /* instance_init */
- NULL
+ sizeof (TnyFolderStatsClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_folder_stats_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyFolderStats),
+ 0, /* n_preallocs */
+ tny_folder_stats_instance_init, /* instance_init */
+ NULL
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyFolderStats",
+ &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyFolderStats",
- &info, 0);
- }
-
- return type;
+GType
+tny_folder_stats_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_stats_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail/tny-seekable.c
===================================================================
--- libtinymail/tny-seekable.c (revision 3665)
+++ libtinymail/tny-seekable.c (working copy)
@@ -116,31 +116,34 @@
}
}
-GType
-tny_seekable_get_type (void)
+static gpointer
+tny_seekable_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnySeekableIface),
- tny_seekable_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnySeekableIface),
+ tny_seekable_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnySeekable", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnySeekable", &info, 0);
- return type;
+ return GUINT_TO_POINTER (type);
}
-
+GType
+tny_seekable_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_seekable_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymail/tny-msg.c
===================================================================
--- libtinymail/tny-msg.c (revision 3665)
+++ libtinymail/tny-msg.c (working copy)
@@ -209,35 +209,37 @@
}
}
-GType
-tny_msg_get_type (void)
+static gpointer
+tny_msg_register_type (gpointer notused)
{
- static GType type = 0;
-
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+
+ static const GTypeInfo info =
{
- sizeof (TnyMsgIface),
- tny_msg_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyMsgIface),
+ tny_msg_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyMsg", &info, 0);
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyMsg", &info, 0);
+
+ g_type_interface_add_prerequisite (type, TNY_TYPE_MIME_PART);
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
+
+ return GUINT_TO_POINTER (type);
+}
- g_type_interface_add_prerequisite (type, TNY_TYPE_MIME_PART);
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
-
- }
-
- return type;
+GType
+tny_msg_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_msg_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
-
Index: libtinymail/tny-account-store.c
===================================================================
--- libtinymail/tny-account-store.c (revision 3665)
+++ libtinymail/tny-account-store.c (working copy)
@@ -383,7 +383,31 @@
return;
}
+gpointer
+tny_account_store_register_type (gpointer notused)
+{
+ GType type = 0;
+ static const GTypeInfo info =
+ {
+ sizeof (TnyAccountStoreIface),
+ tny_account_store_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
+ };
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyAccountStore", &info, 0);
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_account_store_get_type:
*
@@ -395,31 +419,29 @@
GType
tny_account_store_get_type (void)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyAccountStoreIface),
- tny_account_store_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
- };
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyAccountStore", &info, 0);
+ static GOnce once = G_ONCE_INIT;
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
+ g_once (&once, tny_account_store_register_type, NULL);
- }
- return type;
+ return GPOINTER_TO_UINT (once.retval);
}
+static gpointer
+tny_alert_type_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_ALERT_TYPE_INFO, "TNY_ALERT_TYPE_INFO", "info" },
+ { TNY_ALERT_TYPE_WARNING, "TNY_ALERT_TYPE_WARNING", "warning" },
+ { TNY_ALERT_TYPE_ERROR, "TNY_ALERT_TYPE_ERROR", "error" },
+ { 0, NULL, NULL }
+ };
+
+ etype = g_enum_register_static ("TnyAlertType", values);
+
+ return GUINT_TO_POINTER (etype);
+}
+
/**
* tny_alert_type_get_type:
*
@@ -431,19 +453,28 @@
GType
tny_alert_type_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_ALERT_TYPE_INFO, "TNY_ALERT_TYPE_INFO", "info" },
- { TNY_ALERT_TYPE_WARNING, "TNY_ALERT_TYPE_WARNING", "warning" },
- { TNY_ALERT_TYPE_ERROR, "TNY_ALERT_TYPE_ERROR", "error" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyAlertType", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+
+ g_once (&once, tny_alert_type_register_type, NULL);
+
+ return GPOINTER_TO_UINT (once.retval);;
}
+static gpointer
+tny_get_accounts_request_type_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS, "TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS", "transport" },
+ { TNY_ACCOUNT_STORE_STORE_ACCOUNTS, "TNY_ACCOUNT_STORE_STORE_ACCOUNTS", "store" },
+ { TNY_ACCOUNT_STORE_BOTH, "TNY_ACCOUNT_STORE_BOTH", "both" },
+ { 0, NULL, NULL }
+ };
+
+ etype = g_enum_register_static ("TnyGetAccountsRequestType", values);
+ return GUINT_TO_POINTER (etype);
+}
+
/**
* tny_get_accounts_request_type_get_type:
*
@@ -455,21 +486,24 @@
GType
tny_get_accounts_request_type_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS, "TNY_ACCOUNT_STORE_TRANSPORT_ACCOUNTS", "transport" },
- { TNY_ACCOUNT_STORE_STORE_ACCOUNTS, "TNY_ACCOUNT_STORE_STORE_ACCOUNTS", "store" },
- { TNY_ACCOUNT_STORE_BOTH, "TNY_ACCOUNT_STORE_BOTH", "both" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyGetAccountsRequestType", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_get_accounts_request_type_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
+static gpointer
+tny_account_store_signal_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_ACCOUNT_STORE_CONNECTING_STARTED, "TNY_ACCOUNT_STORE_CONNECTING_STARTED", "started" },
+ { TNY_ACCOUNT_STORE_LAST_SIGNAL, "TNY_ACCOUNT_STORE_LAST_SIGNAL", "last-signal" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnyAccountStoreSignal", values);
+ return GUINT_TO_POINTER (etype);
+}
-
/**
* tny_account_store_signal_get_type:
*
@@ -481,14 +515,9 @@
GType
tny_account_store_signal_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_ACCOUNT_STORE_CONNECTING_STARTED, "TNY_ACCOUNT_STORE_CONNECTING_STARTED", "started" },
- { TNY_ACCOUNT_STORE_LAST_SIGNAL, "TNY_ACCOUNT_STORE_LAST_SIGNAL", "last-signal" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyAccountStoreSignal", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+
+ g_once (&once, tny_account_store_signal_register_type, NULL);
+
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-store-account.c
===================================================================
--- libtinymail/tny-store-account.c (revision 3665)
+++ libtinymail/tny-store-account.c (working copy)
@@ -188,6 +188,34 @@
}
}
+static gpointer
+tny_store_account_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyStoreAccountIface),
+ tny_store_account_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
+ };
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyStoreAccount", &info, 0);
+
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
+ g_type_interface_add_prerequisite (type, TNY_TYPE_FOLDER_STORE);
+ g_type_interface_add_prerequisite (type, TNY_TYPE_ACCOUNT);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_store_account_get_type:
*
@@ -198,36 +226,24 @@
GType
tny_store_account_get_type (void)
{
- static GType type = 0;
-
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyStoreAccountIface),
- tny_store_account_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
- };
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyStoreAccount", &info, 0);
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_store_account_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- g_type_interface_add_prerequisite (type, TNY_TYPE_FOLDER_STORE);
- g_type_interface_add_prerequisite (type, TNY_TYPE_ACCOUNT);
-
- }
-
- return type;
+static gpointer
+tny_store_account_signal_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_STORE_ACCOUNT_SUBSCRIPTION_CHANGED, "TNY_STORE_ACCOUNT_SUBSCRIPTION_CHANGED", "subscription_changed" },
+ { TNY_STORE_ACCOUNT_LAST_SIGNAL, "TNY_STORE_ACCOUNT_LAST_SIGNAL", "last-signal" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnyStoreAccountSignal", values);
+ return GUINT_TO_POINTER (etype);
}
-
/**
* tny_status_code_get_type:
*
@@ -238,14 +254,7 @@
GType
tny_store_account_signal_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_STORE_ACCOUNT_SUBSCRIPTION_CHANGED, "TNY_STORE_ACCOUNT_SUBSCRIPTION_CHANGED", "subscription_changed" },
- { TNY_STORE_ACCOUNT_LAST_SIGNAL, "TNY_STORE_ACCOUNT_LAST_SIGNAL", "last-signal" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyStoreAccountSignal", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_store_account_signal_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-transport-account.c
===================================================================
--- libtinymail/tny-transport-account.c (revision 3665)
+++ libtinymail/tny-transport-account.c (working copy)
@@ -70,31 +70,36 @@
}
}
-GType
-tny_transport_account_get_type (void)
+static gpointer
+tny_transport_account_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyTransportAccountIface),
- tny_transport_account_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
+ sizeof (TnyTransportAccountIface),
+ tny_transport_account_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyTransportAccount", &info, 0);
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyTransportAccount", &info, 0);
+
+ g_type_interface_add_prerequisite (type, TNY_TYPE_ACCOUNT);
- g_type_interface_add_prerequisite (type, TNY_TYPE_ACCOUNT);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_transport_account_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_transport_account_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-header.c
===================================================================
--- libtinymail/tny-header.c (revision 3665)
+++ libtinymail/tny-header.c (working copy)
@@ -622,34 +622,62 @@
}
}
-GType
-tny_header_get_type (void)
+static gpointer
+tny_header_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyHeaderIface),
- tny_header_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyHeaderIface),
+ tny_header_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
+
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyHeader", &info, 0);
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyHeader", &info, 0);
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
+GType
+tny_header_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_header_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
- }
-
- return type;
+static gpointer
+tny_header_flags_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GFlagsValue values[] = {
+ { TNY_HEADER_FLAG_ANSWERED, "TNY_HEADER_FLAG_ANSWERED", "answered" },
+ { TNY_HEADER_FLAG_DELETED, "TNY_HEADER_FLAG_DELETED", "deleted" },
+ { TNY_HEADER_FLAG_DRAFT, "TNY_HEADER_FLAG_DRAFT", "draft" },
+ { TNY_HEADER_FLAG_FLAGGED, "TNY_HEADER_FLAG_FLAGGED", "flagged" },
+ { TNY_HEADER_FLAG_SEEN, "TNY_HEADER_FLAG_SEEN", "seen" },
+ { TNY_HEADER_FLAG_ATTACHMENTS, "TNY_HEADER_FLAG_ATTACHMENTS", "attachments" },
+ { TNY_HEADER_FLAG_CACHED, "TNY_HEADER_FLAG_CACHED", "cached" },
+ { TNY_HEADER_FLAG_PARTIAL, "TNY_HEADER_FLAG_PARTIAL", "partial" },
+ { TNY_HEADER_FLAG_EXPUNGED, "TNY_HEADER_FLAG_EXPUNGED", "expunged" },
+ { TNY_HEADER_FLAG_HIGH_PRIORITY, "TNY_HEADER_FLAG_HIGH_PRIORITY", "high-priority" },
+ { TNY_HEADER_FLAG_NORMAL_PRIORITY, "TNY_HEADER_FLAG_NORMAL_PRIORITY", "normal-priority" },
+ { TNY_HEADER_FLAG_LOW_PRIORITY, "TNY_HEADER_FLAG_LOW_PRIORITY", "low-priority" },
+ { TNY_HEADER_FLAG_SUSPENDED, "TNY_HEADER_FLAG_SUSPENDED", "suspended" },
+ { 0, NULL, NULL }
+ };
+ etype = g_flags_register_static ("TnyHeaderFlags", values);
+ return GUINT_TO_POINTER (etype);
}
/**
@@ -662,27 +690,7 @@
GType
tny_header_flags_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GFlagsValue values[] = {
- { TNY_HEADER_FLAG_ANSWERED, "TNY_HEADER_FLAG_ANSWERED", "answered" },
- { TNY_HEADER_FLAG_DELETED, "TNY_HEADER_FLAG_DELETED", "deleted" },
- { TNY_HEADER_FLAG_DRAFT, "TNY_HEADER_FLAG_DRAFT", "draft" },
- { TNY_HEADER_FLAG_FLAGGED, "TNY_HEADER_FLAG_FLAGGED", "flagged" },
- { TNY_HEADER_FLAG_SEEN, "TNY_HEADER_FLAG_SEEN", "seen" },
- { TNY_HEADER_FLAG_ATTACHMENTS, "TNY_HEADER_FLAG_ATTACHMENTS", "attachments" },
- { TNY_HEADER_FLAG_CACHED, "TNY_HEADER_FLAG_CACHED", "cached" },
- { TNY_HEADER_FLAG_PARTIAL, "TNY_HEADER_FLAG_PARTIAL", "partial" },
- { TNY_HEADER_FLAG_EXPUNGED, "TNY_HEADER_FLAG_EXPUNGED", "expunged" },
- { TNY_HEADER_FLAG_HIGH_PRIORITY, "TNY_HEADER_FLAG_HIGH_PRIORITY", "high-priority" },
- { TNY_HEADER_FLAG_NORMAL_PRIORITY, "TNY_HEADER_FLAG_NORMAL_PRIORITY", "normal-priority" },
- { TNY_HEADER_FLAG_LOW_PRIORITY, "TNY_HEADER_FLAG_LOW_PRIORITY", "low-priority" },
- { TNY_HEADER_FLAG_SUSPENDED, "TNY_HEADER_FLAG_SUSPENDED", "suspended" },
- { 0, NULL, NULL }
- };
- etype = g_flags_register_static ("TnyHeaderFlags", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_header_flags_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
-
Index: libtinymail/tny-iterator.c
===================================================================
--- libtinymail/tny-iterator.c (revision 3665)
+++ libtinymail/tny-iterator.c (working copy)
@@ -237,30 +237,34 @@
}
}
-GType
-tny_iterator_get_type (void)
+static gpointer
+tny_iterator_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyIteratorIface),
- tny_iterator_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyIteratorIface),
+ tny_iterator_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyIterator", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyIterator", &info, 0);
- return type;
+ return GUINT_TO_POINTER (type);
}
+GType
+tny_iterator_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_iterator_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymail/tny-expunged-header.c
===================================================================
--- libtinymail/tny-expunged-header.c (revision 3665)
+++ libtinymail/tny-expunged-header.c (working copy)
@@ -198,13 +198,11 @@
return (TnyHeader *) g_object_new (TNY_TYPE_EXPUNGED_HEADER, NULL);
}
-GType
-tny_expunged_header_get_type (void)
+static gpointer
+tny_expunged_header_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+ static const GTypeInfo info =
{
sizeof (TnyExpungedHeaderClass),
NULL, /* base_init */
@@ -217,22 +215,29 @@
tny_expunged_header_instance_init, /* instance_init */
NULL
};
+
-
- static const GInterfaceInfo tny_header_info =
+ static const GInterfaceInfo tny_header_info =
{
(GInterfaceInitFunc) tny_header_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyExpungedHeader",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_HEADER,
+ &tny_header_info);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyExpungedHeader",
- &info, 0);
-
- g_type_add_interface_static (type, TNY_TYPE_HEADER,
- &tny_header_info);
-
- }
- return type;
+GType
+tny_expunged_header_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_expunged_header_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-combined-account.c
===================================================================
--- libtinymail/tny-combined-account.c (revision 3665)
+++ libtinymail/tny-combined-account.c (working copy)
@@ -552,14 +552,11 @@
object_class->finalize = tny_combined_account_finalize;
}
-
-GType
-tny_combined_account_get_type (void)
+static gpointer
+tny_combined_account_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+ static const GTypeInfo info =
{
sizeof (TnyCombinedAccountClass),
NULL, /* base_init */
@@ -572,53 +569,61 @@
tny_combined_account_instance_init, /* instance_init */
NULL
};
-
-
- static const GInterfaceInfo tny_store_account_info =
+
+
+ static const GInterfaceInfo tny_store_account_info =
{
(GInterfaceInitFunc) tny_store_account_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
-
- static const GInterfaceInfo tny_transport_account_info =
+
+ static const GInterfaceInfo tny_transport_account_info =
{
(GInterfaceInitFunc) tny_transport_account_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
-
- static const GInterfaceInfo tny_account_info =
+
+ static const GInterfaceInfo tny_account_info =
{
(GInterfaceInitFunc) tny_account_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
-
- static const GInterfaceInfo tny_folder_store_info =
+
+ static const GInterfaceInfo tny_folder_store_info =
{
(GInterfaceInitFunc) tny_folder_store_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyCombinedAccount",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_ACCOUNT,
+ &tny_account_info);
+
+ g_type_add_interface_static (type, TNY_TYPE_FOLDER_STORE,
+ &tny_folder_store_info);
+
+ g_type_add_interface_static (type, TNY_TYPE_STORE_ACCOUNT,
+ &tny_store_account_info);
+
+ g_type_add_interface_static (type, TNY_TYPE_TRANSPORT_ACCOUNT,
+ &tny_transport_account_info);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyCombinedAccount",
- &info, 0);
+GType
+tny_combined_account_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
- g_type_add_interface_static (type, TNY_TYPE_ACCOUNT,
- &tny_account_info);
+ g_once (&once, tny_combined_account_register_type, NULL);
- g_type_add_interface_static (type, TNY_TYPE_FOLDER_STORE,
- &tny_folder_store_info);
-
- g_type_add_interface_static (type, TNY_TYPE_STORE_ACCOUNT,
- &tny_store_account_info);
-
- g_type_add_interface_static (type, TNY_TYPE_TRANSPORT_ACCOUNT,
- &tny_transport_account_info);
-
-
- }
- return type;
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-folder-store-change.c
===================================================================
--- libtinymail/tny-folder-store-change.c (revision 3665)
+++ libtinymail/tny-folder-store-change.c (working copy)
@@ -350,6 +350,31 @@
return;
}
+static gpointer
+tny_folder_store_change_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyFolderStoreChangeClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_folder_store_change_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyFolderStoreChange),
+ 0, /* n_preallocs */
+ tny_folder_store_change_instance_init, /* instance_init */
+ NULL
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyFolderStoreChange",
+ &info, 0);
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_folder_store_change_get_type:
*
@@ -360,33 +385,24 @@
GType
tny_folder_store_change_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_store_change_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyFolderStoreChangeClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_folder_store_change_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyFolderStoreChange),
- 0, /* n_preallocs */
- tny_folder_store_change_instance_init, /* instance_init */
- NULL
- };
-
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyFolderStoreChange",
- &info, 0);
- }
-
- return type;
+static gpointer
+tny_folder_store_change_changed_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GFlagsValue values[] = {
+ { TNY_FOLDER_STORE_CHANGE_CHANGED_CREATED_FOLDERS, "TNY_FOLDER_STORE_CHANGE_CHANGED_CREATED_FOLDERS", "created-folders" },
+ { TNY_FOLDER_STORE_CHANGE_CHANGED_REMOVED_FOLDERS, "TNY_FOLDER_STORE_CHANGE_CHANGED_REMOVED_FOLDERS", "removed-folders" },
+ { 0, NULL, NULL }
+ };
+ etype = g_flags_register_static ("TnyFolderStoreChangeChanged", values);
+ return GUINT_TO_POINTER (etype);
}
-
/**
* tny_folder_store_change_changed_get_type:
*
@@ -397,14 +413,7 @@
GType
tny_folder_store_change_changed_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GFlagsValue values[] = {
- { TNY_FOLDER_STORE_CHANGE_CHANGED_CREATED_FOLDERS, "TNY_FOLDER_STORE_CHANGE_CHANGED_CREATED_FOLDERS", "created-folders" },
- { TNY_FOLDER_STORE_CHANGE_CHANGED_REMOVED_FOLDERS, "TNY_FOLDER_STORE_CHANGE_CHANGED_REMOVED_FOLDERS", "removed-folders" },
- { 0, NULL, NULL }
- };
- etype = g_flags_register_static ("TnyFolderStoreChangeChanged", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_store_change_changed_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-simple-list-iterator.c
===================================================================
--- libtinymail/tny-simple-list-iterator.c (revision 3665)
+++ libtinymail/tny-simple-list-iterator.c (working copy)
@@ -240,41 +240,46 @@
return;
}
-GType
-_tny_simple_list_iterator_get_type (void)
+static gpointer
+_tny_simple_list_iterator_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnySimpleListIteratorClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_simple_list_iterator_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnySimpleListIterator),
- 0, /* n_preallocs */
- tny_simple_list_iterator_instance_init, /* instance_init */
- NULL
+ sizeof (TnySimpleListIteratorClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_simple_list_iterator_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnySimpleListIterator),
+ 0, /* n_preallocs */
+ tny_simple_list_iterator_instance_init, /* instance_init */
+ NULL
};
-
- static const GInterfaceInfo tny_iterator_info =
+
+ static const GInterfaceInfo tny_iterator_info =
{
- (GInterfaceInitFunc) tny_iterator_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_iterator_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnySimpleListIterator",
+ &info, 0);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnySimpleListIterator",
- &info, 0);
+ g_type_add_interface_static (type, TNY_TYPE_ITERATOR,
+ &tny_iterator_info);
- g_type_add_interface_static (type, TNY_TYPE_ITERATOR,
- &tny_iterator_info);
- }
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+_tny_simple_list_iterator_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, _tny_simple_list_iterator_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-folder-store-observer.c
===================================================================
--- libtinymail/tny-folder-store-observer.c (revision 3665)
+++ libtinymail/tny-folder-store-observer.c (working copy)
@@ -71,30 +71,33 @@
}
}
-GType
-tny_folder_store_observer_get_type (void)
+static gpointer
+tny_folder_store_observer_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyFolderStoreObserverIface),
- tny_folder_store_observer_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyFolderStoreObserverIface),
+ tny_folder_store_observer_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyFolderStoreObserver", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyFolderStoreObserver", &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_folder_store_observer_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_store_observer_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail/tny-mime-part.c
===================================================================
--- libtinymail/tny-mime-part.c (revision 3665)
+++ libtinymail/tny-mime-part.c (working copy)
@@ -987,31 +987,35 @@
}
}
-GType
-tny_mime_part_get_type (void)
+static gpointer
+tny_mime_part_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyMimePartIface),
- tny_mime_part_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyMimePartIface),
+ tny_mime_part_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
+
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyMimePart", &info, 0);
+
+ return GUINT_TO_POINTER (type);
+}
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyMimePart", &info, 0);
-
- }
-
- return type;
+GType
+tny_mime_part_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_mime_part_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-device.c
===================================================================
--- libtinymail/tny-device.c (revision 3665)
+++ libtinymail/tny-device.c (working copy)
@@ -222,37 +222,56 @@
}
}
-GType
-tny_device_get_type (void)
+static gpointer
+tny_device_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyDeviceIface),
- tny_device_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyDeviceIface),
+ tny_device_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
+
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyDevice", &info, 0);
+
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyDevice", &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- }
+GType
+tny_device_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
- return type;
+ g_once (&once, tny_device_register_type, NULL);
+
+ return GPOINTER_TO_UINT (once.retval);
}
+static gpointer
+tny_device_signal_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_DEVICE_CONNECTION_CHANGED, "TNY_DEVICE_CONNECTION_CHANGED", "connection-changed" },
+ { TNY_DEVICE_LAST_SIGNAL, "TNY_DEVICE_LAST_SIGNAL", "last-signal" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnyDeviceSignal", values);
+ return GUINT_TO_POINTER (etype);
+}
/**
* tny_device_signal_get_type:
@@ -264,14 +283,7 @@
GType
tny_device_signal_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_DEVICE_CONNECTION_CHANGED, "TNY_DEVICE_CONNECTION_CHANGED", "connection-changed" },
- { TNY_DEVICE_LAST_SIGNAL, "TNY_DEVICE_LAST_SIGNAL", "last-signal" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyDeviceSignal", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_device_signal_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-simple-list.c
===================================================================
--- libtinymail/tny-simple-list.c (revision 3665)
+++ libtinymail/tny-simple-list.c (working copy)
@@ -218,14 +218,12 @@
return TNY_LIST (self);
}
-GType
-tny_simple_list_get_type (void)
+static gpointer
+tny_simple_list_register_type (gpointer notused)
{
- static GType object_type = 0;
+ GType object_type = 0;
- if (G_UNLIKELY(object_type == 0))
- {
- static const GTypeInfo object_info =
+ static const GTypeInfo object_info =
{
sizeof (TnySimpleListClass),
NULL, /* base_init */
@@ -238,20 +236,26 @@
(GInstanceInitFunc) tny_simple_list_init,
NULL
};
+
+ static const GInterfaceInfo tny_list_info = {
+ (GInterfaceInitFunc) tny_list_init,
+ NULL,
+ NULL
+ };
+
+ object_type = g_type_register_static (G_TYPE_OBJECT,
+ "TnySimpleList", &object_info, 0);
+
+ g_type_add_interface_static (object_type, TNY_TYPE_LIST,
+ &tny_list_info);
- static const GInterfaceInfo tny_list_info = {
- (GInterfaceInitFunc) tny_list_init,
- NULL,
- NULL
- };
+ return GUINT_TO_POINTER (object_type);
+}
- object_type = g_type_register_static (G_TYPE_OBJECT,
- "TnySimpleList", &object_info, 0);
-
- g_type_add_interface_static (object_type, TNY_TYPE_LIST,
- &tny_list_info);
-
- }
-
- return object_type;
+GType
+tny_simple_list_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_simple_list_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-folder-store.c
===================================================================
--- libtinymail/tny-folder-store.c (revision 3665)
+++ libtinymail/tny-folder-store.c (working copy)
@@ -420,31 +420,33 @@
}
}
-GType
-tny_folder_store_get_type (void)
+static gpointer
+tny_folder_store_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyFolderStoreIface),
- tny_folder_store_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyFolderStoreIface),
+ tny_folder_store_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyFolderStore", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyFolderStore", &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_folder_store_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_store_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
-
Index: libtinymail/tny-merge-folder.c
===================================================================
--- libtinymail/tny-merge-folder.c (revision 3665)
+++ libtinymail/tny-merge-folder.c (working copy)
@@ -2003,13 +2003,11 @@
}
-GType
-tny_merge_folder_get_type (void)
+static gpointer
+tny_merge_folder_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+ static const GTypeInfo info =
{
sizeof (TnyMergeFolderClass),
NULL, /* base_init */
@@ -2022,32 +2020,38 @@
tny_merge_folder_instance_init, /* instance_init */
NULL
};
-
-
- static const GInterfaceInfo tny_folder_info =
+
+
+ static const GInterfaceInfo tny_folder_info =
{
(GInterfaceInitFunc) tny_folder_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
-
- static const GInterfaceInfo tny_folder_observer_info =
+
+ static const GInterfaceInfo tny_folder_observer_info =
{
(GInterfaceInitFunc) tny_folder_observer_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyMergeFolder",
+ &info, 0);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyMergeFolder",
- &info, 0);
+ g_type_add_interface_static (type, TNY_TYPE_FOLDER,
+ &tny_folder_info);
+
+ g_type_add_interface_static (type, TNY_TYPE_FOLDER_OBSERVER,
+ &tny_folder_observer_info);
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_FOLDER,
- &tny_folder_info);
-
- g_type_add_interface_static (type, TNY_TYPE_FOLDER_OBSERVER,
- &tny_folder_observer_info);
- }
-
- return type;
+GType
+tny_merge_folder_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_merge_folder_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-folder.c
===================================================================
--- libtinymail/tny-folder.c (revision 3665)
+++ libtinymail/tny-folder.c (working copy)
@@ -1581,35 +1581,65 @@
tny_folder_initialized = TRUE;
}
-GType
-tny_folder_get_type (void)
+static gpointer
+tny_folder_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyFolderIface),
- tny_folder_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyFolderIface),
+ tny_folder_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyFolder", &info, 0);
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyFolder", &info, 0);
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- }
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- return type;
+ return GUINT_TO_POINTER (type);
}
+GType
+tny_folder_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
+
+static gpointer
+tny_folder_type_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_FOLDER_TYPE_UNKNOWN, "TNY_FOLDER_TYPE_UNKNOWN", "unknown" },
+ { TNY_FOLDER_TYPE_NORMAL, "TNY_FOLDER_TYPE_NORMAL", "normal" },
+ { TNY_FOLDER_TYPE_INBOX, "TNY_FOLDER_TYPE_INBOX", "inbox" },
+ { TNY_FOLDER_TYPE_OUTBOX, "TNY_FOLDER_TYPE_OUTBOX", "outbox" },
+ { TNY_FOLDER_TYPE_TRASH, "TNY_FOLDER_TYPE_TRASH", "trash" },
+ { TNY_FOLDER_TYPE_JUNK, "TNY_FOLDER_TYPE_JUNK", "junk" },
+ { TNY_FOLDER_TYPE_SENT, "TNY_FOLDER_TYPE_SENT", "sent" },
+ { TNY_FOLDER_TYPE_ROOT, "TNY_FOLDER_TYPE_ROOT", "root" },
+ { TNY_FOLDER_TYPE_NOTES, "TNY_FOLDER_TYPE_NOTES", "notes" },
+ { TNY_FOLDER_TYPE_DRAFTS, "TNY_FOLDER_TYPE_DRAFTS", "drafts" },
+ { TNY_FOLDER_TYPE_CONTACTS, "TNY_FOLDER_TYPE_CONTACTS", "contacts" },
+ { TNY_FOLDER_TYPE_CALENDAR, "TNY_FOLDER_TYPE_CALENDAR", "calendar" },
+ { TNY_FOLDER_TYPE_ARCHIVE, "TNY_FOLDER_TYPE_ARCHIVE", "archive" },
+ { TNY_FOLDER_TYPE_MERGE, "TNY_FOLDER_TYPE_MERGE", "merge" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnyFolderType", values);
+ return GUINT_TO_POINTER (etype);
+}
+
/**
* tny_folder_type_get_type:
*
@@ -1620,32 +1650,24 @@
GType
tny_folder_type_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_FOLDER_TYPE_UNKNOWN, "TNY_FOLDER_TYPE_UNKNOWN", "unknown" },
- { TNY_FOLDER_TYPE_NORMAL, "TNY_FOLDER_TYPE_NORMAL", "normal" },
- { TNY_FOLDER_TYPE_INBOX, "TNY_FOLDER_TYPE_INBOX", "inbox" },
- { TNY_FOLDER_TYPE_OUTBOX, "TNY_FOLDER_TYPE_OUTBOX", "outbox" },
- { TNY_FOLDER_TYPE_TRASH, "TNY_FOLDER_TYPE_TRASH", "trash" },
- { TNY_FOLDER_TYPE_JUNK, "TNY_FOLDER_TYPE_JUNK", "junk" },
- { TNY_FOLDER_TYPE_SENT, "TNY_FOLDER_TYPE_SENT", "sent" },
- { TNY_FOLDER_TYPE_ROOT, "TNY_FOLDER_TYPE_ROOT", "root" },
- { TNY_FOLDER_TYPE_NOTES, "TNY_FOLDER_TYPE_NOTES", "notes" },
- { TNY_FOLDER_TYPE_DRAFTS, "TNY_FOLDER_TYPE_DRAFTS", "drafts" },
- { TNY_FOLDER_TYPE_CONTACTS, "TNY_FOLDER_TYPE_CONTACTS", "contacts" },
- { TNY_FOLDER_TYPE_CALENDAR, "TNY_FOLDER_TYPE_CALENDAR", "calendar" },
- { TNY_FOLDER_TYPE_ARCHIVE, "TNY_FOLDER_TYPE_ARCHIVE", "archive" },
- { TNY_FOLDER_TYPE_MERGE, "TNY_FOLDER_TYPE_MERGE", "merge" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyFolderType", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_type_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
+static gpointer
+tny_folder_caps_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GFlagsValue values[] = {
+ { TNY_FOLDER_CAPS_WRITABLE, "TNY_FOLDER_CAPS_WRITABLE", "writable" },
+ { TNY_FOLDER_CAPS_PUSHEMAIL, "TNY_FOLDER_CAPS_PUSHEMAIL", "pushemail" },
+ { 0, NULL, NULL }
+ };
+ etype = g_flags_register_static ("TnyFolderCaps", values);
+ return GUINT_TO_POINTER (etype);
+}
-
/**
* tny_folder_caps_get_type:
*
@@ -1656,18 +1678,24 @@
GType
tny_folder_caps_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GFlagsValue values[] = {
- { TNY_FOLDER_CAPS_WRITABLE, "TNY_FOLDER_CAPS_WRITABLE", "writable" },
- { TNY_FOLDER_CAPS_PUSHEMAIL, "TNY_FOLDER_CAPS_PUSHEMAIL", "pushemail" },
- { 0, NULL, NULL }
- };
- etype = g_flags_register_static ("TnyFolderCaps", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_caps_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
+static gpointer
+tny_folder_signal_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_FOLDER_FOLDER_INSERTED, "TNY_FOLDER_FOLDER_INSERTED", "inserted" },
+ { TNY_FOLDER_FOLDERS_RELOADED, "TNY_FOLDER_FOLDERS_RELOADED", "reloaded" },
+ { TNY_FOLDER_LAST_SIGNAL, "TNY_FOLDER_LAST_SIGNAL", "last-signal" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnyFolderSignal", values);
+ return GUINT_TO_POINTER (etype);
+}
/**
* tny_folder_signal_get_type:
@@ -1679,15 +1707,7 @@
GType
tny_folder_signal_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_FOLDER_FOLDER_INSERTED, "TNY_FOLDER_FOLDER_INSERTED", "inserted" },
- { TNY_FOLDER_FOLDERS_RELOADED, "TNY_FOLDER_FOLDERS_RELOADED", "reloaded" },
- { TNY_FOLDER_LAST_SIGNAL, "TNY_FOLDER_LAST_SIGNAL", "last-signal" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyFolderSignal", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_signal_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-list.c
===================================================================
--- libtinymail/tny-list.c (revision 3665)
+++ libtinymail/tny-list.c (working copy)
@@ -434,30 +434,34 @@
}
}
-GType
-tny_list_get_type (void)
+static gpointer
+tny_list_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyListIface),
- tny_list_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyListIface),
+ tny_list_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyList", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyList", &info, 0);
- return type;
+ return GUINT_TO_POINTER (type);
}
+GType
+tny_list_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_list_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
Index: libtinymail/tny-connection-policy.c
===================================================================
--- libtinymail/tny-connection-policy.c (revision 3665)
+++ libtinymail/tny-connection-policy.c (working copy)
@@ -155,30 +155,35 @@
}
}
-GType
-tny_connection_policy_get_type (void)
+static gpointer
+tny_connection_policy_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyConnectionPolicyIface),
- tny_connection_policy_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyConnectionPolicyIface),
+ tny_connection_policy_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyConnectionPolicy", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyConnectionPolicy", &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_connection_policy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+
+ g_once (&once, tny_connection_policy_register_type, NULL);
+
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail/tny-account.c
===================================================================
--- libtinymail/tny-account.c (revision 3665)
+++ libtinymail/tny-account.c (working copy)
@@ -1089,6 +1089,31 @@
}
}
+static gpointer
+tny_account_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnyAccountIface),
+ tny_account_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
+ };
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyAccount", &info, 0);
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_account_get_type:
*
@@ -1099,30 +1124,23 @@
GType
tny_account_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnyAccountIface),
- tny_account_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
- };
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyAccount", &info, 0);
+ g_once (&once, tny_account_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
- }
-
- return type;
+static gpointer
+tny_account_type_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_ACCOUNT_TYPE_STORE, "TNY_ACCOUNT_TYPE_STORE", "store" },
+ { TNY_ACCOUNT_TYPE_TRANSPORT, "TNY_ACCOUNT_TYPE_TRANSPORT", "transport" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnyAccountType", values);
+ return GUINT_TO_POINTER (etype);
}
/**
@@ -1135,20 +1153,27 @@
GType
tny_account_type_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_ACCOUNT_TYPE_STORE, "TNY_ACCOUNT_TYPE_STORE", "store" },
- { TNY_ACCOUNT_TYPE_TRANSPORT, "TNY_ACCOUNT_TYPE_TRANSPORT", "transport" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyAccountType", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+
+ g_once (&once, tny_account_type_register_type, NULL);
+
+ return GPOINTER_TO_UINT (once.retval);
}
+static gpointer
+tny_account_signal_type_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_ACCOUNT_CONNECTION_STATUS_CHANGED, "TNY_ACCOUNT_CONNECTION_STATUS_CHANGED", "connection_status_changed" },
+ { TNY_ACCOUNT_CHANGED, "TNY_ACCOUNT_CHANGED", "changed" },
+ { TNY_ACCOUNT_LAST_SIGNAL, "TNY_ACCOUNT_LAST_SIGNAL", "last_signal" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnyAccountSignal", values);
+ return GUINT_TO_POINTER (etype);
+}
-
/**
* tny_account_signal_type_get_type:
*
@@ -1159,19 +1184,30 @@
GType
tny_account_signal_type_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_ACCOUNT_CONNECTION_STATUS_CHANGED, "TNY_ACCOUNT_CONNECTION_STATUS_CHANGED", "connection_status_changed" },
- { TNY_ACCOUNT_CHANGED, "TNY_ACCOUNT_CHANGED", "changed" },
- { TNY_ACCOUNT_LAST_SIGNAL, "TNY_ACCOUNT_LAST_SIGNAL", "last_signal" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyAccountSignal", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+
+ g_once (&once, tny_account_signal_type_register_type, NULL);
+
+ return GPOINTER_TO_UINT (once.retval);
}
+static gpointer
+tny_connection_status_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_CONNECTION_STATUS_DISCONNECTED, "TNY_CONNECTION_STATUS_DISCONNECTED", "disconnected" },
+ { TNY_CONNECTION_STATUS_DISCONNECTED_BROKEN, "TNY_CONNECTION_STATUS_DISCONNECTED_BROKEN", "disconnected-broken" },
+ { TNY_CONNECTION_STATUS_CONNECTED_BROKEN, "TNY_CONNECTION_STATUS_CONNECTED_BROKEN", "connected-broken" },
+ { TNY_CONNECTION_STATUS_CONNECTED, "TNY_CONNECTION_STATUS_CONNECTED", "connected" },
+ { TNY_CONNECTION_STATUS_RECONNECTING, "TNY_CONNECTION_STATUS_RECONNECTING", "reconnecting" },
+ { TNY_CONNECTION_STATUS_INIT, "TNY_CONNECTION_STATUS_INIT", "init" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnyConnectionStatus", values);
+ return GUINT_TO_POINTER (etype);
+}
+
/**
* tny_connection_status_get_type:
*
@@ -1182,20 +1218,11 @@
GType
tny_connection_status_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_CONNECTION_STATUS_DISCONNECTED, "TNY_CONNECTION_STATUS_DISCONNECTED", "disconnected" },
- { TNY_CONNECTION_STATUS_DISCONNECTED_BROKEN, "TNY_CONNECTION_STATUS_DISCONNECTED_BROKEN", "disconnected-broken" },
- { TNY_CONNECTION_STATUS_CONNECTED_BROKEN, "TNY_CONNECTION_STATUS_CONNECTED_BROKEN", "connected-broken" },
- { TNY_CONNECTION_STATUS_CONNECTED, "TNY_CONNECTION_STATUS_CONNECTED", "connected" },
- { TNY_CONNECTION_STATUS_RECONNECTING, "TNY_CONNECTION_STATUS_RECONNECTING", "reconnecting" },
- { TNY_CONNECTION_STATUS_INIT, "TNY_CONNECTION_STATUS_INIT", "init" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyConnectionStatus", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+
+ g_once (&once, tny_connection_status_register_type, NULL);
+
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-fs-stream.c
===================================================================
--- libtinymail/tny-fs-stream.c (revision 3665)
+++ libtinymail/tny-fs-stream.c (working copy)
@@ -356,53 +356,56 @@
return;
}
-GType
-tny_fs_stream_get_type (void)
+static gpointer
+tny_fs_stream_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyFsStreamClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) tny_fs_stream_class_init, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (TnyFsStream),
- 0, /* n_preallocs */
- tny_fs_stream_instance_init, /* instance_init */
- NULL
+ sizeof (TnyFsStreamClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tny_fs_stream_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (TnyFsStream),
+ 0, /* n_preallocs */
+ tny_fs_stream_instance_init, /* instance_init */
+ NULL
};
-
- static const GInterfaceInfo tny_stream_info =
+
+ static const GInterfaceInfo tny_stream_info =
{
- (GInterfaceInitFunc) tny_stream_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_stream_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
-
- static const GInterfaceInfo tny_seekable_info =
+
+ static const GInterfaceInfo tny_seekable_info =
{
- (GInterfaceInitFunc) tny_seekable_init, /* interface_init */
- NULL, /* interface_finalize */
- NULL /* interface_data */
+ (GInterfaceInitFunc) tny_seekable_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyFsStream",
+ &info, 0);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyFsStream",
- &info, 0);
+ g_type_add_interface_static (type, TNY_TYPE_STREAM,
+ &tny_stream_info);
+
+ g_type_add_interface_static (type, TNY_TYPE_SEEKABLE,
+ &tny_seekable_info);
+
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_STREAM,
- &tny_stream_info);
-
- g_type_add_interface_static (type, TNY_TYPE_SEEKABLE,
- &tny_seekable_info);
-
- }
-
- return type;
+GType
+tny_fs_stream_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_fs_stream_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
-
Index: libtinymail/tny-folder-store-query.c
===================================================================
--- libtinymail/tny-folder-store-query.c (revision 3665)
+++ libtinymail/tny-folder-store-query.c (working copy)
@@ -118,14 +118,12 @@
}
-GType
-tny_folder_store_query_get_type (void)
+static gpointer
+tny_folder_store_query_register_type (gpointer notused)
{
- static GType object_type = 0;
+ GType object_type = 0;
- if (G_UNLIKELY(object_type == 0))
- {
- static const GTypeInfo object_info =
+ static const GTypeInfo object_info =
{
sizeof (TnyFolderStoreQueryClass),
NULL, /* base_init */
@@ -138,28 +136,26 @@
(GInstanceInitFunc) tny_folder_store_query_init,
NULL
};
- object_type = g_type_register_static (G_TYPE_OBJECT,
- "TnyFolderStoreQuery", &object_info, 0);
- }
+ object_type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyFolderStoreQuery", &object_info, 0);
- return object_type;
+ return GUINT_TO_POINTER (object_type);
}
-/**
- * tny_folder_store_query_item_get_type:
- *
- * GType system helper function
- *
- * returns: a #GType
- **/
GType
-tny_folder_store_query_item_get_type (void)
+tny_folder_store_query_get_type (void)
{
- static GType object_type = 0;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_store_query_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
- if (G_UNLIKELY(object_type == 0))
- {
- static const GTypeInfo object_info =
+static gpointer
+tny_folder_store_query_item_register_type (gpointer notused)
+{
+ GType object_type = 0;
+
+ static const GTypeInfo object_info =
{
sizeof (TnyFolderStoreQueryItemClass),
NULL, /* base_init */
@@ -172,12 +168,25 @@
(GInstanceInitFunc) tny_folder_store_query_item_init,
NULL
};
- object_type = g_type_register_static (G_TYPE_OBJECT,
- "TnyFolderStoreQueryItem", &object_info, 0);
+ object_type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyFolderStoreQueryItem", &object_info, 0);
+
+ return GUINT_TO_POINTER (object_type);
+}
- }
-
- return object_type;
+/**
+ * tny_folder_store_query_item_get_type:
+ *
+ * GType system helper function
+ *
+ * returns: a #GType
+ **/
+GType
+tny_folder_store_query_item_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_store_query_item_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
static gchar*
@@ -366,6 +375,23 @@
return (const gchar*) item->pattern;
}
+static gpointer
+tny_folder_store_query_option_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GFlagsValue values[] = {
+ { TNY_FOLDER_STORE_QUERY_OPTION_SUBSCRIBED, "TNY_FOLDER_STORE_QUERY_OPTION_SUBSCRIBED", "subscribed" },
+ { TNY_FOLDER_STORE_QUERY_OPTION_UNSUBSCRIBED, "TNY_FOLDER_STORE_QUERY_OPTION_UNSUBSCRIBED", "unsubscribed" },
+ { TNY_FOLDER_STORE_QUERY_OPTION_MATCH_ON_NAME, "TNY_FOLDER_STORE_QUERY_OPTION_MATCH_ON_NAME", "match_on_name" },
+ { TNY_FOLDER_STORE_QUERY_OPTION_MATCH_ON_ID, "TNY_FOLDER_STORE_QUERY_OPTION_MATCH_ON_ID", "match_on_id" },
+ { TNY_FOLDER_STORE_QUERY_OPTION_PATTERN_IS_CASE_INSENSITIVE, "TNY_FOLDER_STORE_QUERY_OPTION_PATTERN_IS_CASE_INSENSITIVE", "pattern_is_case_insensitive" },
+ { TNY_FOLDER_STORE_QUERY_OPTION_PATTERN_IS_REGEX, "TNY_FOLDER_STORE_QUERY_OPTION_PATTERN_IS_REGEX", "pattern_is_regex" },
+ { 0, NULL, NULL }
+ };
+ etype = g_flags_register_static ("TnyFolderStoreQueryOption", values);
+ return GUINT_TO_POINTER (etype);
+}
+
/**
* tny_folder_store_query_option_get_type:
*
@@ -376,18 +402,7 @@
GType
tny_folder_store_query_option_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GFlagsValue values[] = {
- { TNY_FOLDER_STORE_QUERY_OPTION_SUBSCRIBED, "TNY_FOLDER_STORE_QUERY_OPTION_SUBSCRIBED", "subscribed" },
- { TNY_FOLDER_STORE_QUERY_OPTION_UNSUBSCRIBED, "TNY_FOLDER_STORE_QUERY_OPTION_UNSUBSCRIBED", "unsubscribed" },
- { TNY_FOLDER_STORE_QUERY_OPTION_MATCH_ON_NAME, "TNY_FOLDER_STORE_QUERY_OPTION_MATCH_ON_NAME", "match_on_name" },
- { TNY_FOLDER_STORE_QUERY_OPTION_MATCH_ON_ID, "TNY_FOLDER_STORE_QUERY_OPTION_MATCH_ON_ID", "match_on_id" },
- { TNY_FOLDER_STORE_QUERY_OPTION_PATTERN_IS_CASE_INSENSITIVE, "TNY_FOLDER_STORE_QUERY_OPTION_PATTERN_IS_CASE_INSENSITIVE", "pattern_is_case_insensitive" },
- { TNY_FOLDER_STORE_QUERY_OPTION_PATTERN_IS_REGEX, "TNY_FOLDER_STORE_QUERY_OPTION_PATTERN_IS_REGEX", "pattern_is_regex" },
- { 0, NULL, NULL }
- };
- etype = g_flags_register_static ("TnyFolderStoreQueryOption", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_folder_store_query_option_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-send-queue.c
===================================================================
--- libtinymail/tny-send-queue.c (revision 3665)
+++ libtinymail/tny-send-queue.c (working copy)
@@ -278,6 +278,31 @@
}
}
+static gpointer
+tny_send_queue_register_type (gpointer notused)
+{
+ GType type = 0;
+
+ static const GTypeInfo info =
+ {
+ sizeof (TnySendQueueIface),
+ tny_send_queue_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
+ };
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnySendQueue", &info, 0);
+ g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
+
+ return GUINT_TO_POINTER (type);
+}
+
/**
* tny_send_queue_get_type:
*
@@ -288,30 +313,24 @@
GType
tny_send_queue_get_type (void)
{
- static GType type = 0;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_send_queue_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
+}
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
- {
- sizeof (TnySendQueueIface),
- tny_send_queue_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
- };
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnySendQueue", &info, 0);
- g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
-
- }
-
- return type;
+static gpointer
+tny_send_queue_signal_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_SEND_QUEUE_MSG_SENDING, "TNY_SEND_QUEUE_MSG_SENDING", "msg-sending" },
+ { TNY_SEND_QUEUE_MSG_SENT, "TNY_SEND_QUEUE_MSG_SENT", "msg-sent" },
+ { TNY_SEND_QUEUE_ERROR_HAPPENED, "TNY_SEND_QUEUE_ERROR_HAPPENED", "error-happened" },
+ { TNY_SEND_QUEUE_LAST_SIGNAL, "TNY_SEND_QUEUE_LAST_SIGNAL", "last-signal" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnySendQueueSignal", values);
+ return GUINT_TO_POINTER (etype);
}
/**
@@ -324,16 +343,7 @@
GType
tny_send_queue_signal_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_SEND_QUEUE_MSG_SENDING, "TNY_SEND_QUEUE_MSG_SENDING", "msg-sending" },
- { TNY_SEND_QUEUE_MSG_SENT, "TNY_SEND_QUEUE_MSG_SENT", "msg-sent" },
- { TNY_SEND_QUEUE_ERROR_HAPPENED, "TNY_SEND_QUEUE_ERROR_HAPPENED", "error-happened" },
- { TNY_SEND_QUEUE_LAST_SIGNAL, "TNY_SEND_QUEUE_LAST_SIGNAL", "last-signal" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnySendQueueSignal", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_send_queue_signal_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-lockable.c
===================================================================
--- libtinymail/tny-lockable.c (revision 3665)
+++ libtinymail/tny-lockable.c (working copy)
@@ -79,29 +79,33 @@
return;
}
-GType
-tny_lockable_get_type (void)
+static gpointer
+tny_lockable_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyLockableIface),
- tny_lockable_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL, /* instance_init */
- NULL
+ sizeof (TnyLockableIface),
+ tny_lockable_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL, /* instance_init */
+ NULL
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyLockable", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyLockable", &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_lockable_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_lockable_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-msg-remove-strategy.c
===================================================================
--- libtinymail/tny-msg-remove-strategy.c (revision 3665)
+++ libtinymail/tny-msg-remove-strategy.c (working copy)
@@ -95,28 +95,32 @@
initialized = TRUE;
}
-GType
-tny_msg_remove_strategy_get_type (void)
+static gpointer
+tny_msg_remove_strategy_register_type (gpointer notused)
{
- static GType type = 0;
+ GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ static const GTypeInfo info =
{
- sizeof (TnyMsgRemoveStrategyIface),
- tny_msg_remove_strategy_base_init, /* base_init */
- NULL, /* base_finalize */
- NULL, /* class_init */
- NULL, /* class_finalize */
- NULL, /* class_data */
- 0,
- 0, /* n_preallocs */
- NULL /* instance_init */
+ sizeof (TnyMsgRemoveStrategyIface),
+ tny_msg_remove_strategy_base_init, /* base_init */
+ NULL, /* base_finalize */
+ NULL, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ 0,
+ 0, /* n_preallocs */
+ NULL /* instance_init */
};
- type = g_type_register_static (G_TYPE_INTERFACE,
- "TnyMsgRemoveStrategy", &info, 0);
- }
+ type = g_type_register_static (G_TYPE_INTERFACE,
+ "TnyMsgRemoveStrategy", &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- return type;
+GType
+tny_msg_remove_strategy_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_msg_remove_strategy_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-status.c
===================================================================
--- libtinymail/tny-status.c (revision 3665)
+++ libtinymail/tny-status.c (working copy)
@@ -290,6 +290,20 @@
**/
+static gpointer
+tny_status_domain_register_type (gpointer notused)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_FOLDER_STATUS, "TNY_FOLDER_STATUS", "folder_status" },
+ { TNY_GET_MSG_QUEUE_STATUS, "TNY_GET_MSG_QUEUE_STATUS", "get_msg_queue_status" },
+ { TNY_GET_SUPPORTED_SECURE_AUTH_STATUS, "TNY_GET_SUPPORTED_SECURE_AUTH_STATUS", "secured-auth-status" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnyStatusDomain", values);
+ return GUINT_TO_POINTER (etype);
+}
+
/**
* tny_status_domain_get_type:
*
@@ -300,19 +314,28 @@
GType
tny_status_domain_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_FOLDER_STATUS, "TNY_FOLDER_STATUS", "folder_status" },
- { TNY_GET_MSG_QUEUE_STATUS, "TNY_GET_MSG_QUEUE_STATUS", "get_msg_queue_status" },
- { TNY_GET_SUPPORTED_SECURE_AUTH_STATUS, "TNY_GET_SUPPORTED_SECURE_AUTH_STATUS", "secured-auth-status" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyStatusDomain", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_status_domain_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
+static gpointer
+tny_status_code_register_type (void)
+{
+ GType etype = 0;
+ static const GEnumValue values[] = {
+ { TNY_FOLDER_STATUS_CODE_REFRESH, "TNY_FOLDER_STATUS_CODE_REFRESH", "folder_status_code_refresh" },
+ { TNY_FOLDER_STATUS_CODE_GET_MSG, "TNY_FOLDER_STATUS_CODE_GET_MSG", "folder_status_code_get_msg" },
+ { TNY_GET_MSG_QUEUE_STATUS_GET_MSG, "TNY_GET_MSG_QUEUE_STATUS_GET_MSG", "get_msg_queue_status_get_msg" },
+ { TNY_FOLDER_STATUS_CODE_XFER_MSGS, "TNY_FOLDER_STATUS_CODE_XFER_MSGS", "xfer-msgs" },
+ { TNY_FOLDER_STATUS_CODE_COPY_FOLDER, "TNY_FOLDER_STATUS_CODE_COPY_FOLDER", "copy-folder" },
+ { TNY_GET_SUPPORTED_SECURE_AUTH_STATUS_GET_SECURE_AUTH, "TNY_GET_SUPPORTED_SECURE_AUTH_STATUS_GET_SECURE_AUTH", "get-secure-auth" },
+ { TNY_FOLDER_STATUS_CODE_SYNC, "TNY_FOLDER_STATUS_CODE_SYNC", "code-sync" },
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("TnyStatusCode", values);
+ return GUINT_TO_POINTER (etype);
+}
/**
* tny_status_code_get_type:
@@ -324,19 +347,7 @@
GType
tny_status_code_get_type (void)
{
- static GType etype = 0;
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TNY_FOLDER_STATUS_CODE_REFRESH, "TNY_FOLDER_STATUS_CODE_REFRESH", "folder_status_code_refresh" },
- { TNY_FOLDER_STATUS_CODE_GET_MSG, "TNY_FOLDER_STATUS_CODE_GET_MSG", "folder_status_code_get_msg" },
- { TNY_GET_MSG_QUEUE_STATUS_GET_MSG, "TNY_GET_MSG_QUEUE_STATUS_GET_MSG", "get_msg_queue_status_get_msg" },
- { TNY_FOLDER_STATUS_CODE_XFER_MSGS, "TNY_FOLDER_STATUS_CODE_XFER_MSGS", "xfer-msgs" },
- { TNY_FOLDER_STATUS_CODE_COPY_FOLDER, "TNY_FOLDER_STATUS_CODE_COPY_FOLDER", "copy-folder" },
- { TNY_GET_SUPPORTED_SECURE_AUTH_STATUS_GET_SECURE_AUTH, "TNY_GET_SUPPORTED_SECURE_AUTH_STATUS_GET_SECURE_AUTH", "get-secure-auth" },
- { TNY_FOLDER_STATUS_CODE_SYNC, "TNY_FOLDER_STATUS_CODE_SYNC", "code-sync" },
- { 0, NULL, NULL }
- };
- etype = g_enum_register_static ("TnyStatusCode", values);
- }
- return etype;
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_status_code_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
Index: libtinymail/tny-noop-lockable.c
===================================================================
--- libtinymail/tny-noop-lockable.c (revision 3665)
+++ libtinymail/tny-noop-lockable.c (working copy)
@@ -92,13 +92,11 @@
}
-GType
-tny_noop_lockable_get_type (void)
+static gpointer
+tny_noop_lockable_register_type (gpointer notused)
{
- static GType type = 0;
- if (G_UNLIKELY(type == 0))
- {
- static const GTypeInfo info =
+ GType type = 0;
+ static const GTypeInfo info =
{
sizeof (TnyNoopLockableClass),
NULL, /* base_init */
@@ -112,22 +110,27 @@
NULL
};
-
- static const GInterfaceInfo tny_lockable_info =
+ static const GInterfaceInfo tny_lockable_info =
{
(GInterfaceInitFunc) tny_lockable_init, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
+
+ type = g_type_register_static (G_TYPE_OBJECT,
+ "TnyNoopLockable",
+ &info, 0);
+
+ g_type_add_interface_static (type, TNY_TYPE_LOCKABLE,
+ &tny_lockable_info);
- type = g_type_register_static (G_TYPE_OBJECT,
- "TnyNoopLockable",
- &info, 0);
+ return GUINT_TO_POINTER (type);
+}
- g_type_add_interface_static (type, TNY_TYPE_LOCKABLE,
- &tny_lockable_info);
-
- }
-
- return type;
+GType
+tny_noop_lockable_get_type (void)
+{
+ static GOnce once = G_ONCE_INIT;
+ g_once (&once, tny_noop_lockable_register_type, NULL);
+ return GPOINTER_TO_UINT (once.retval);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]