aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/gal-view-factory.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-07-03 05:17:40 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-07-06 04:40:50 +0800
commitbb5f5ad90beabd459e27d7aaac44d92c9b106c00 (patch)
treef1475231191b25673c2539c6955703cf9e7b7982 /e-util/gal-view-factory.c
parent880cf290462273744bd3da929d9f10964e618e2a (diff)
downloadgsoc2013-evolution-bb5f5ad90beabd459e27d7aaac44d92c9b106c00.tar
gsoc2013-evolution-bb5f5ad90beabd459e27d7aaac44d92c9b106c00.tar.gz
gsoc2013-evolution-bb5f5ad90beabd459e27d7aaac44d92c9b106c00.tar.bz2
gsoc2013-evolution-bb5f5ad90beabd459e27d7aaac44d92c9b106c00.tar.lz
gsoc2013-evolution-bb5f5ad90beabd459e27d7aaac44d92c9b106c00.tar.xz
gsoc2013-evolution-bb5f5ad90beabd459e27d7aaac44d92c9b106c00.tar.zst
gsoc2013-evolution-bb5f5ad90beabd459e27d7aaac44d92c9b106c00.zip
GalViewFactoryClass: Remove the get_type_code() method.
GalViewFactory can now use its "gal_view_type" class member to peek at the appropriate GalViewClass and return its static "type_code" string.
Diffstat (limited to 'e-util/gal-view-factory.c')
-rw-r--r--e-util/gal-view-factory.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/e-util/gal-view-factory.c b/e-util/gal-view-factory.c
index c6de38a110..d235a63d86 100644
--- a/e-util/gal-view-factory.c
+++ b/e-util/gal-view-factory.c
@@ -50,13 +50,19 @@ const gchar *
gal_view_factory_get_type_code (GalViewFactory *factory)
{
GalViewFactoryClass *class;
+ GalViewClass *view_class;
g_return_val_if_fail (GAL_IS_VIEW_FACTORY (factory), NULL);
class = GAL_VIEW_FACTORY_GET_CLASS (factory);
- g_return_val_if_fail (class->get_type_code != NULL, NULL);
- return class->get_type_code (factory);
+ /* All GalView types are registered statically, so there's no
+ * harm in dereferencing the class pointer after unreffing it. */
+ view_class = g_type_class_ref (class->gal_view_type);
+ g_return_val_if_fail (GAL_IS_VIEW_CLASS (view_class), NULL);
+ g_type_class_unref (view_class);
+
+ return view_class->type_code;
}
/**