From e0862e69a791b6eae6b35e6d93c28fdd2c92eee1 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 1 Jun 2004 04:16:26 +0000 Subject: ** See #58827. 2004-05-27 Not Zed ** See #58827. * e-shell-window.c (switch_view): api change * e-shell.c (impl_Shell_handleURI): Fixed for api change. (impl_Shell_handleURI): check the component alias for an alternate uri schema path. 'quick hack' for activating components from command line. This may, or may not, continue to function. * e-component-registry.c (e_component_registry_peek_info): added an id for search type. (e_component_registry_peek_info_for_uri_schema): ^ makes this redundant, removed. (e_component_registry_activate): fixed for api change. svn path=/trunk/; revision=26137 --- shell/e-component-registry.c | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) (limited to 'shell/e-component-registry.c') diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c index e023872257..9abe47197c 100644 --- a/shell/e-component-registry.c +++ b/shell/e-component-registry.c @@ -282,44 +282,36 @@ e_component_registry_peek_list (EComponentRegistry *registry) EComponentInfo * e_component_registry_peek_info (EComponentRegistry *registry, - const char *id) + enum _EComponentRegistryField field, + const char *key) { - GSList *p; + GSList *p, *q; g_return_val_if_fail (E_IS_COMPONENT_REGISTRY (registry), NULL); for (p = registry->priv->infos; p != NULL; p = p->next) { EComponentInfo *info = p->data; - if (strcmp (info->id, id) == 0) - return info; - } - - return NULL; -} - - -EComponentInfo * -e_component_registry_peek_info_for_uri_schema (EComponentRegistry *registry, - const char *requested_schema) -{ - GSList *p, *q; - - for (p = registry->priv->infos; p != NULL; p = p->next) { - EComponentInfo *info = p->data; - - for (q = info->uri_schemas; q != NULL; q = q->next) { - const char *schema = q->data; - - if (strcmp (schema, requested_schema) == 0) + switch (field) { + case ECR_FIELD_ID: + if (strcmp (info->id, key) == 0) return info; + break; + case ECR_FIELD_ALIAS: + if (strcmp (info->alias, key) == 0) + return info; + break; + case ECR_FIELD_SCHEMA: + for (q = info->uri_schemas; q != NULL; q = q->next) + if (strcmp((char *)q->data, key) == 0) + return info; + break; } } return NULL; } - GNOME_Evolution_Component e_component_registry_activate (EComponentRegistry *registry, const char *id, @@ -329,7 +321,7 @@ e_component_registry_activate (EComponentRegistry *registry, g_return_val_if_fail (E_IS_COMPONENT_REGISTRY (registry), CORBA_OBJECT_NIL); - info = e_component_registry_peek_info (registry, id); + info = e_component_registry_peek_info (registry, ECR_FIELD_ID, id); if (info == NULL) { g_warning (G_GNUC_FUNCTION " - Unknown id \"%s\"", id); return CORBA_OBJECT_NIL; -- cgit v1.2.3