diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-07 07:23:57 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-09-09 02:53:45 +0800 |
commit | fa9051e04051156a9e11e2af72a0d7342f4ea2e4 (patch) | |
tree | 0d064bddb366257c660722359dc33f5ef3c610c7 /shell/e-shell.c | |
parent | c9e7aa7aee6b407659843131cc8becdafa71992a (diff) | |
download | gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.gz gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.zst gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.zip |
Finish killing Bonobo.
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r-- | shell/e-shell.c | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c index d2a82675ae..bf664649fc 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -371,7 +371,7 @@ shell_load_modules (EShell *shell) } } -/* Helper for shell_process_backend() */ +/* Helper for shell_add_backend() */ static void shell_split_and_insert_items (GHashTable *hash_table, const gchar *items, @@ -392,14 +392,17 @@ shell_split_and_insert_items (GHashTable *hash_table, } static void -shell_process_backend (EShell *shell, - EShellBackend *shell_backend) +shell_add_backend (GType type, + EShell *shell) { EShellBackendClass *class; + EShellBackend *shell_backend; GHashTable *backends_by_name; GHashTable *backends_by_scheme; const gchar *string; + shell_backend = g_object_new (type, "shell", shell, NULL); + shell->priv->loaded_backends = g_list_insert_sorted ( shell->priv->loaded_backends, shell_backend, (GCompareFunc) e_shell_backend_compare); @@ -425,26 +428,6 @@ shell_process_backend (EShell *shell, } static void -shell_create_backends (EShell *shell) -{ - GType *children; - guint ii, n_children; - - /* Create an instance of each EShellBackend subclass. */ - children = g_type_children (E_TYPE_SHELL_BACKEND, &n_children); - - for (ii = 0; ii < n_children; ii++) { - EShellBackend *shell_backend; - GType type = children[ii]; - - shell_backend = g_object_new (type, "shell", shell, NULL); - shell_process_backend (shell, shell_backend); - } - - g_free (children); -} - -static void shell_sm_quit_requested_cb (EShell *shell, EggSMClient *sm_client) { @@ -596,7 +579,10 @@ shell_constructed (GObject *object) e_file_lock_create (); shell_load_modules (E_SHELL (object)); - shell_create_backends (E_SHELL (object)); + + e_type_traverse ( + E_TYPE_SHELL_BACKEND, (ETypeFunc) + shell_add_backend, object); } static gboolean |