diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-06-28 10:22:40 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-06-28 10:22:40 +0800 |
commit | 764cfb5a6ba195958b1b3b814fdb584d6a5ff63b (patch) | |
tree | 1c49f5dca5a940c4a4715ba055738da25d64498b /shell/e-component-registry.c | |
parent | ad31ac2c9e472dd03e537b7bc3008cd9c54842e8 (diff) | |
download | gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar.gz gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar.bz2 gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar.lz gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar.xz gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.tar.zst gsoc2013-evolution-764cfb5a6ba195958b1b3b814fdb584d6a5ff63b.zip |
Added a URI schema registry to the shell, and changed the bootstrap
sequence to get the schema lists from the components and register them
into it.
svn path=/trunk/; revision=10553
Diffstat (limited to 'shell/e-component-registry.c')
-rw-r--r-- | shell/e-component-registry.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c index aa76ff0656..b5df6601da 100644 --- a/shell/e-component-registry.c +++ b/shell/e-component-registry.c @@ -142,6 +142,7 @@ register_component (EComponentRegistry *component_registry, GNOME_Evolution_ShellComponent component_corba_interface; GNOME_Evolution_Shell shell_corba_interface; GNOME_Evolution_FolderTypeList *supported_types; + GNOME_Evolution_URISchemaList *supported_schemas; Component *component; EvolutionShellComponentClient *client; CORBA_Environment ev; @@ -166,6 +167,8 @@ register_component (EComponentRegistry *component_registry, component_corba_interface = bonobo_object_corba_objref (BONOBO_OBJECT (client)); shell_corba_interface = bonobo_object_corba_objref (BONOBO_OBJECT (priv->shell)); + /* Register the supported folder types. */ + supported_types = GNOME_Evolution_ShellComponent__get_supported_types (component_corba_interface, &ev); if (ev._major != CORBA_NO_EXCEPTION || supported_types->_length == 0) { bonobo_object_unref (BONOBO_OBJECT (client)); @@ -178,7 +181,7 @@ register_component (EComponentRegistry *component_registry, component = component_new (id, client); g_hash_table_insert (priv->component_id_to_component, component->id, component); bonobo_object_unref (BONOBO_OBJECT (client)); - + for (i = 0; i < supported_types->_length; i++) { const GNOME_Evolution_FolderType *type; @@ -201,6 +204,27 @@ register_component (EComponentRegistry *component_registry, CORBA_free (supported_types); + /* Register the supported external URI schemas. */ + + supported_schemas = GNOME_Evolution_ShellComponent__get_external_uri_schemas (component_corba_interface, &ev); + if (ev._major == CORBA_NO_EXCEPTION) { + EUriSchemaRegistry *uri_schema_registry; + + uri_schema_registry = e_shell_get_uri_schema_registry (priv->shell); + + for (i = 0; i < supported_schemas->_length; i++) { + const CORBA_char *schema; + + schema = supported_schemas->_buffer[i]; + if (! e_uri_schema_registry_set_handler_for_schema (uri_schema_registry, schema, component->client)) + g_warning ("Cannot register schema `%s' for component %s", schema, component->id); + else + g_print ("Registered handler for schema `%s' -- %s\n", schema, component->id); + } + + CORBA_free (supported_schemas); + } + return TRUE; } |