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-sidebar.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-sidebar.c')
-rw-r--r-- | mail/e-mail-shell-sidebar.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/mail/e-mail-shell-sidebar.c b/mail/e-mail-shell-sidebar.c index 0429cdabf9..6f6bdf7bf8 100644 --- a/mail/e-mail-shell-sidebar.c +++ b/mail/e-mail-shell-sidebar.c @@ -43,6 +43,7 @@ enum { }; static gpointer parent_class; +static GType mail_shell_sidebar_type; static void mail_shell_sidebar_selection_changed_cb (EShellSidebar *shell_sidebar, @@ -302,28 +303,28 @@ mail_shell_sidebar_init (EMailShellSidebar *mail_shell_sidebar) GType e_mail_shell_sidebar_get_type (void) { - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EMailShellSidebarClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) mail_shell_sidebar_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EMailShellSidebar), - 0, /* n_preallocs */ - (GInstanceInitFunc) mail_shell_sidebar_init, - NULL /* value_table */ - }; - - type = g_type_register_static ( - E_TYPE_SHELL_SIDEBAR, "EMailShellSidebar", - &type_info, 0); - } + return mail_shell_sidebar_type; +} - return type; +void +e_mail_shell_sidebar_register_type (GTypeModule *type_module) +{ + static const GTypeInfo type_info = { + sizeof (EMailShellSidebarClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) mail_shell_sidebar_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (EMailShellSidebar), + 0, /* n_preallocs */ + (GInstanceInitFunc) mail_shell_sidebar_init, + NULL /* value_table */ + }; + + mail_shell_sidebar_type = g_type_module_register_type ( + type_module, E_TYPE_SHELL_SIDEBAR, + "EMailShellSidebar", &type_info, 0); } GtkWidget * |