aboutsummaryrefslogtreecommitdiffstats
path: root/modules/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-06 00:34:19 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-06 04:40:50 +0800
commit7bb795b299758e6a81536b81c19693f353106105 (patch)
tree35937e1022645939bf0f3635848b7f86e03fb19b /modules/addressbook
parentd629e6850a64b826fad60857a6b6945149ca8214 (diff)
downloadgsoc2013-evolution-7bb795b299758e6a81536b81c19693f353106105.tar.gz
gsoc2013-evolution-7bb795b299758e6a81536b81c19693f353106105.tar.zst
gsoc2013-evolution-7bb795b299758e6a81536b81c19693f353106105.zip
Remove gal_view_collection_add_factory().
No longer needed. Instead, use g_type_ensure() to ensure the necessary GalView subclasses are registered in the GType system before loading a GalViewCollection. Best place to ensure types is from GClassInitFunc.
Diffstat (limited to 'modules/addressbook')
-rw-r--r--modules/addressbook/e-book-shell-view-private.c23
-rw-r--r--modules/addressbook/e-book-shell-view.c6
2 files changed, 7 insertions, 22 deletions
diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c
index 79112202f2..cfb8213ae0 100644
--- a/modules/addressbook/e-book-shell-view-private.c
+++ b/modules/addressbook/e-book-shell-view-private.c
@@ -27,8 +27,6 @@
#include "e-book-shell-view-private.h"
-#include "addressbook/gui/widgets/gal-view-factory-minicard.h"
-
static void
open_contact (EBookShellView *book_shell_view,
EContact *contact,
@@ -456,25 +454,6 @@ book_shell_view_source_removed_cb (ESourceRegistry *registry,
}
static void
-book_shell_view_load_view_collection (EShellViewClass *shell_view_class)
-{
- GalViewCollection *collection;
- GalViewFactory *factory;
-
- collection = shell_view_class->view_collection;
-
- factory = gal_view_factory_etable_new ();
- gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
-
- factory = gal_view_factory_minicard_new ();
- gal_view_collection_add_factory (collection, factory);
- g_object_unref (factory);
-
- gal_view_collection_load (collection);
-}
-
-static void
book_shell_view_notify_view_id_cb (EBookShellView *book_shell_view)
{
EBookShellContent *book_shell_content;
@@ -514,7 +493,7 @@ e_book_shell_view_private_init (EBookShellView *book_shell_view,
priv->preview_index = -1;
if (!gal_view_collection_loaded (shell_view_class->view_collection))
- book_shell_view_load_view_collection (shell_view_class);
+ gal_view_collection_load (shell_view_class->view_collection);
g_signal_connect (
book_shell_view, "notify::view-id",
diff --git a/modules/addressbook/e-book-shell-view.c b/modules/addressbook/e-book-shell-view.c
index 1f76cad705..c36d200438 100644
--- a/modules/addressbook/e-book-shell-view.c
+++ b/modules/addressbook/e-book-shell-view.c
@@ -25,6 +25,8 @@
#include "e-book-shell-view-private.h"
+#include "addressbook/gui/widgets/gal-view-minicard.h"
+
static gpointer parent_class;
static GType book_shell_view_type;
@@ -370,6 +372,10 @@ book_shell_view_class_init (EBookShellViewClass *class)
shell_view_class->new_shell_sidebar = e_book_shell_sidebar_new;
shell_view_class->execute_search = book_shell_view_execute_search;
shell_view_class->update_actions = book_shell_view_update_actions;
+
+ /* Ensure the GalView types we need are registered. */
+ g_type_ensure (GAL_TYPE_VIEW_ETABLE);
+ g_type_ensure (GAL_TYPE_VIEW_MINICARD);
}
static void