diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-11 01:18:28 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-11 01:18:28 +0800 |
commit | 5eb12906c4242a576ad6fac4d229f096d3aab17a (patch) | |
tree | 7c09011257167be9c0f456a7c19c21298469ea82 /mail/e-mail-shell-content.c | |
parent | 92e942499bffca812dcbc229f6c88ebb640e403a (diff) | |
download | gsoc2013-evolution-5eb12906c4242a576ad6fac4d229f096d3aab17a.tar gsoc2013-evolution-5eb12906c4242a576ad6fac4d229f096d3aab17a.tar.gz gsoc2013-evolution-5eb12906c4242a576ad6fac4d229f096d3aab17a.tar.bz2 gsoc2013-evolution-5eb12906c4242a576ad6fac4d229f096d3aab17a.tar.lz gsoc2013-evolution-5eb12906c4242a576ad6fac4d229f096d3aab17a.tar.xz gsoc2013-evolution-5eb12906c4242a576ad6fac4d229f096d3aab17a.tar.zst gsoc2013-evolution-5eb12906c4242a576ad6fac4d229f096d3aab17a.zip |
Use the proper idiom for loading types in a GTypeModule.
Also, combine calendar, memo, and task backends into a single module,
similar to how it worked under Bonobo.
Diffstat (limited to 'mail/e-mail-shell-content.c')
-rw-r--r-- | mail/e-mail-shell-content.c | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/mail/e-mail-shell-content.c b/mail/e-mail-shell-content.c index 50bf0471bb..de07873dc2 100644 --- a/mail/e-mail-shell-content.c +++ b/mail/e-mail-shell-content.c @@ -78,6 +78,7 @@ enum { }; static gpointer parent_class; +static GType mail_shell_content_type; static void mail_shell_content_etree_unfreeze (MessageList *message_list, @@ -677,37 +678,38 @@ mail_shell_content_init (EMailShellContent *mail_shell_content) GType e_mail_shell_content_get_type (void) { - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EMailShellContentClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) mail_shell_content_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EMailShellContent), - 0, /* n_preallocs */ - (GInstanceInitFunc) mail_shell_content_init, - NULL /* value_table */ - }; - - static const GInterfaceInfo iface_info = { - (GInterfaceInitFunc) mail_shell_content_iface_init, - (GInterfaceFinalizeFunc) NULL, - NULL /* interface_data */ - }; - - type = g_type_register_static ( - E_TYPE_SHELL_CONTENT, "EMailShellContent", - &type_info, 0); - - g_type_add_interface_static ( - type, E_TYPE_MAIL_READER, &iface_info); - } + return mail_shell_content_type; +} - return type; +void +e_mail_shell_content_register_type (GTypeModule *type_module) +{ + static const GTypeInfo type_info = { + sizeof (EMailShellContentClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) mail_shell_content_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (EMailShellContent), + 0, /* n_preallocs */ + (GInstanceInitFunc) mail_shell_content_init, + NULL /* value_table */ + }; + + static const GInterfaceInfo iface_info = { + (GInterfaceInitFunc) mail_shell_content_iface_init, + (GInterfaceFinalizeFunc) NULL, + NULL /* interface_data */ + }; + + mail_shell_content_type = g_type_module_register_type ( + type_module, E_TYPE_SHELL_CONTENT, + "EMailShellContent", &type_info, 0); + + g_type_module_add_interface ( + type_module, mail_shell_content_type, + E_TYPE_MAIL_READER, &iface_info); } GtkWidget * |