From 5eb12906c4242a576ad6fac4d229f096d3aab17a Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 10 May 2009 13:18:28 -0400 Subject: 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. --- addressbook/gui/component/e-book-shell-view.c | 45 ++++++++++++++------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'addressbook/gui/component/e-book-shell-view.c') diff --git a/addressbook/gui/component/e-book-shell-view.c b/addressbook/gui/component/e-book-shell-view.c index 7520c1e304..44c06be9a3 100644 --- a/addressbook/gui/component/e-book-shell-view.c +++ b/addressbook/gui/component/e-book-shell-view.c @@ -21,8 +21,8 @@ #include "e-book-shell-view-private.h" -GType e_book_shell_view_type = 0; static gpointer parent_class; +static GType book_shell_view_type; static void book_shell_view_source_list_changed_cb (EBookShellView *book_shell_view, @@ -291,27 +291,28 @@ book_shell_view_init (EBookShellView *book_shell_view, } GType -e_book_shell_view_get_type (GTypeModule *type_module) +e_book_shell_view_get_type (void) { - if (e_book_shell_view_type == 0) { - const GTypeInfo type_info = { - sizeof (EBookShellViewClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) book_shell_view_class_init, - (GClassFinalizeFunc) NULL, - NULL, /* class_data */ - sizeof (EBookShellView), - 0, /* n_preallocs */ - (GInstanceInitFunc) book_shell_view_init, - NULL /* value_table */ - }; - - e_book_shell_view_type = - g_type_module_register_type ( - type_module, E_TYPE_SHELL_VIEW, - "EBookShellView", &type_info, 0); - } + return book_shell_view_type; +} - return e_book_shell_view_type; +void +e_book_shell_view_register_type (GTypeModule *type_module) +{ + const GTypeInfo type_info = { + sizeof (EBookShellViewClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) book_shell_view_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (EBookShellView), + 0, /* n_preallocs */ + (GInstanceInitFunc) book_shell_view_init, + NULL /* value_table */ + }; + + book_shell_view_type = g_type_module_register_type ( + type_module, E_TYPE_SHELL_VIEW, + "EBookShellView", &type_info, 0); } -- cgit v1.2.3