From 7bb795b299758e6a81536b81c19693f353106105 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 5 Jul 2013 12:34:19 -0400 Subject: 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. --- e-util/gal-view-collection.c | 31 ------------------------------- e-util/gal-view-collection.h | 4 +--- 2 files changed, 1 insertion(+), 34 deletions(-) (limited to 'e-util') diff --git a/e-util/gal-view-collection.c b/e-util/gal-view-collection.c index 617eaad2ad..badd81bf9f 100644 --- a/e-util/gal-view-collection.c +++ b/e-util/gal-view-collection.c @@ -38,8 +38,6 @@ struct _GalViewCollectionPrivate { GalViewCollectionItem **view_data; gint view_count; - GList *factory_list; - GalViewCollectionItem **removed_view_data; gint removed_view_count; @@ -185,12 +183,6 @@ gal_view_collection_dispose (GObject *object) priv->view_data = NULL; priv->view_count = 0; - g_list_foreach ( - priv->factory_list, - (GFunc) g_object_unref, NULL); - g_list_free (priv->factory_list); - priv->factory_list = NULL; - for (ii = 0; ii < priv->removed_view_count; ii++) gal_view_collection_item_free (priv->removed_view_data[ii]); g_free (priv->removed_view_data); @@ -338,29 +330,6 @@ gal_view_collection_set_storage_directories (GalViewCollection *collection, g_object_notify (G_OBJECT (collection), "user-directory"); } -/** - * gal_view_collection_add_factory - * @collection: The view collection to add a factory to - * @factory: The factory to add. The @collection will add a reference - * to the factory object, so you should unref it after calling this - * function if you no longer need it. - * - * Adds the given factory to this collection. This list is used both - * when loading views from their xml description as well as when the - * user tries to create a new view. - */ -void -gal_view_collection_add_factory (GalViewCollection *collection, - GalViewFactory *factory) -{ - g_return_if_fail (GAL_IS_VIEW_COLLECTION (collection)); - g_return_if_fail (GAL_IS_VIEW_FACTORY (factory)); - - collection->priv->factory_list = g_list_prepend ( - collection->priv->factory_list, - g_object_ref (factory)); -} - static void view_changed (GalView *view, GalViewCollectionItem *item) diff --git a/e-util/gal-view-collection.h b/e-util/gal-view-collection.h index 5cc355410e..700262e6ce 100644 --- a/e-util/gal-view-collection.h +++ b/e-util/gal-view-collection.h @@ -23,7 +23,7 @@ #ifndef GAL_VIEW_COLLECTION_H #define GAL_VIEW_COLLECTION_H -#include +#include /* Standard GObject macros */ #define GAL_TYPE_VIEW_COLLECTION \ @@ -91,8 +91,6 @@ void gal_view_collection_set_storage_directories (GalViewCollection *collection, const gchar *system_dir, const gchar *local_dir); -void gal_view_collection_add_factory (GalViewCollection *collection, - GalViewFactory *factory); /* Query the view collection. */ gint gal_view_collection_get_count (GalViewCollection *collection); -- cgit v1.2.3