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 /addressbook/gui/component/e-book-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 'addressbook/gui/component/e-book-shell-content.c')
-rw-r--r-- | addressbook/gui/component/e-book-shell-content.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/addressbook/gui/component/e-book-shell-content.c b/addressbook/gui/component/e-book-shell-content.c index 8830c797e0..7f7b9483bb 100644 --- a/addressbook/gui/component/e-book-shell-content.c +++ b/addressbook/gui/component/e-book-shell-content.c @@ -22,7 +22,8 @@ #include "e-book-shell-content.h" #include <glib/gi18n.h> -#include <e-util/gconf-bridge.h> + +#include "e-util/gconf-bridge.h" #define E_BOOK_SHELL_CONTENT_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ @@ -42,6 +43,7 @@ enum { }; static gpointer parent_class; +static GType book_shell_view_type; static void book_shell_content_send_message_cb (EBookShellContent *book_shell_content, @@ -296,28 +298,28 @@ book_shell_content_init (EBookShellContent *book_shell_content) GType e_book_shell_content_get_type (void) { - static GType type = 0; - - if (G_UNLIKELY (type == 0)) { - static const GTypeInfo type_info = { - sizeof (EBookShellContentClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) book_shell_content_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EBookShellContent), - 0, /* n_preallocs */ - (GInstanceInitFunc) book_shell_content_init, - NULL /* value_table */ - }; - - type = g_type_register_static ( - E_TYPE_SHELL_CONTENT, "EBookShellContent", - &type_info, 0); - } + return book_shell_view_type; +} - return type; +void +e_book_shell_content_register_type (GTypeModule *type_module) +{ + static const GTypeInfo type_info = { + sizeof (EBookShellContentClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) book_shell_content_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (EBookShellContent), + 0, /* n_preallocs */ + (GInstanceInitFunc) book_shell_content_init, + NULL /* value_table */ + }; + + book_shell_view_type = g_type_module_register_type ( + type_module, E_TYPE_SHELL_CONTENT, + "EBookShellContent", &type_info, 0); } GtkWidget * |