aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-01 00:53:52 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-09-01 00:53:52 +0800
commitf5991437c3e620708f1701310bd1e67b40ca3b42 (patch)
treeb8fbe876e5c5eb0dd0e96d6505aabe898b09c6fb /e-util
parentcd0112576878cb5de3930835ff09f1562e9f5c10 (diff)
downloadgsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar.gz
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar.bz2
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar.lz
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar.xz
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.tar.zst
gsoc2013-evolution-f5991437c3e620708f1701310bd1e67b40ca3b42.zip
Get EConfig and EEvent hooks working again.
There were a number of problems: - Walk the GType tree to find EPluginHook subclasses, instead of just registering the immediate children. - Some EConfig and EEvent subclasses were not being configured properly (particularly the mail and calendar subclasses). - Add preference window pages after the main loop starts to make sure all plugins and plugin hooks are installed first.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-config.c4
-rw-r--r--e-util/e-plugin.c22
2 files changed, 21 insertions, 5 deletions
diff --git a/e-util/e-config.c b/e-util/e-config.c
index 9974da72cb..3695069eea 100644
--- a/e-util/e-config.c
+++ b/e-util/e-config.c
@@ -1654,7 +1654,9 @@ e_config_hook_get_type(void)
* target map enumates the target types available for the implenting
* class.
**/
-void e_config_hook_class_add_target_map(EConfigHookClass *klass, const EConfigHookTargetMap *map)
+void
+e_config_hook_class_add_target_map (EConfigHookClass *klass,
+ const EConfigHookTargetMap *map)
{
g_hash_table_insert(klass->target_map, (gpointer)map->type, (gpointer)map);
}
diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c
index 5c5e55b147..5d77decfd9 100644
--- a/e-util/e-plugin.c
+++ b/e-util/e-plugin.c
@@ -508,14 +508,27 @@ plugin_load_subclasses (void)
}
g_free (children);
+}
- /* Load EPluginHook subclasses. */
+static void
+plugin_load_hook_subclasses (GType parent_type)
+{
+ GType *children;
+ guint n_children, ii;
- children = g_type_children (E_TYPE_PLUGIN_HOOK, &n_children);
+ children = g_type_children (parent_type, &n_children);
for (ii = 0; ii < n_children; ii++) {
EPluginHookClass *hook_class;
EPluginHookClass *dupe_class;
+ gpointer key;
+
+ /* First load the child's children. */
+ plugin_load_hook_subclasses (children[ii]);
+
+ /* Skip abstract types. */
+ if (G_TYPE_IS_ABSTRACT (children[ii]))
+ continue;
hook_class = g_type_class_ref (children[ii]);
@@ -542,8 +555,8 @@ plugin_load_subclasses (void)
continue;
}
- g_hash_table_insert (
- eph_types, (gpointer) hook_class->id, hook_class);
+ key = (gpointer) hook_class->id;
+ g_hash_table_insert (eph_types, key, hook_class);
}
g_free (children);
@@ -571,6 +584,7 @@ e_plugin_load_plugins(void)
* subclasses be registered prior to loading any plugins.
* It greatly simplifies the loading process. */
plugin_load_subclasses ();
+ plugin_load_hook_subclasses (E_TYPE_PLUGIN_HOOK);
client = gconf_client_get_default ();
ep_disabled = gconf_client_get_list (