diff options
author | Not Zed <NotZed@Ximian.com> | 2004-06-01 12:16:26 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-06-01 12:16:26 +0800 |
commit | e0862e69a791b6eae6b35e6d93c28fdd2c92eee1 (patch) | |
tree | 9c14527b5d17ccc489a9edbd22b0cae2807d05b4 /shell/e-component-registry.c | |
parent | b90fd7e8a1ed8939be514ce998f2e95b0f42bd9f (diff) | |
download | gsoc2013-evolution-e0862e69a791b6eae6b35e6d93c28fdd2c92eee1.tar gsoc2013-evolution-e0862e69a791b6eae6b35e6d93c28fdd2c92eee1.tar.gz gsoc2013-evolution-e0862e69a791b6eae6b35e6d93c28fdd2c92eee1.tar.bz2 gsoc2013-evolution-e0862e69a791b6eae6b35e6d93c28fdd2c92eee1.tar.lz gsoc2013-evolution-e0862e69a791b6eae6b35e6d93c28fdd2c92eee1.tar.xz gsoc2013-evolution-e0862e69a791b6eae6b35e6d93c28fdd2c92eee1.tar.zst gsoc2013-evolution-e0862e69a791b6eae6b35e6d93c28fdd2c92eee1.zip |
** See #58827.
2004-05-27 Not Zed <NotZed@Ximian.com>
** 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
Diffstat (limited to 'shell/e-component-registry.c')
-rw-r--r-- | shell/e-component-registry.c | 42 |
1 files changed, 17 insertions, 25 deletions
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; |