From 035744f29bdea64cfb38f2e507020d5914cd666e Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 19 Aug 2008 02:55:45 +0000 Subject: Committing the day's progress. Realized the "New" menu construction algorithm needs to live independently of shell view instances since we lazy load the shell views but have to display all possible "New" items immediately. Prototype the mechanisms for managing the various shell views and keeping track of which one is current. Various other tightening up and rethinking of APIs. svn path=/branches/kill-bonobo/; revision=36022 --- shell/e-shell-registry.c | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'shell/e-shell-registry.c') diff --git a/shell/e-shell-registry.c b/shell/e-shell-registry.c index 91f489111a..14808ebb01 100644 --- a/shell/e-shell-registry.c +++ b/shell/e-shell-registry.c @@ -66,7 +66,7 @@ shell_registry_query_module (const gchar *filename) info = (EShellModuleInfo *) shell_module->priv; - if ((string = G_TYPE_MODULE (shell_module)->name) != NULL) + if ((string = info->name) != NULL) g_hash_table_insert ( modules_by_name, (gpointer) g_intern_string (string), shell_module); @@ -122,32 +122,19 @@ e_shell_registry_list_modules (void) return loaded_modules; } -GType * -e_shell_registry_get_view_types (guint *n_types) +const gchar * +e_shell_registry_get_canonical_name (const gchar *name) { - GType *types; - GList *iter; - guint ii = 0; - - types = g_new0 (GType, g_list_length (loaded_modules) + 1); - - for (iter = loaded_modules; iter != NULL; iter = iter->next) { - EShellModule *shell_module = iter->data; - EShellModuleInfo *info; - - info = (EShellModuleInfo *) shell_module->priv; + EShellModule *shell_module; - /* Allow for modules with no corresponding view type. */ - if (!g_type_is_a (info->shell_view_type, E_TYPE_SHELL_VIEW)) - continue; + g_return_val_if_fail (name != NULL, NULL); - types[ii++] = info->shell_view_type; - } + shell_module = e_shell_registry_get_module_by_name (name); - if (n_types != NULL) - *n_types = ii; + if (shell_module == NULL) + return NULL; - return types; + return G_TYPE_MODULE (shell_module)->name; } EShellModule * -- cgit v1.2.3