diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2003-11-21 01:51:07 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2003-11-21 01:51:07 +0800 |
commit | ebc902721df626e57f28af7ce2f9273d89a859e1 (patch) | |
tree | cec45996321821c370339efd075e3aa309fec139 /shell/e-shell.c | |
parent | 807e7a3c199b0973bb0c33fc39d6e1114bfce13e (diff) | |
download | gsoc2013-evolution-ebc902721df626e57f28af7ce2f9273d89a859e1.tar.gz gsoc2013-evolution-ebc902721df626e57f28af7ce2f9273d89a859e1.tar.zst gsoc2013-evolution-ebc902721df626e57f28af7ce2f9273d89a859e1.zip |
Reimplemented using EComponentRegistry.
* e-shell.c (impl_Shell_handleURI): Reimplemented using
EComponentRegistry.
* main.c (idle_cb): Create a new window even if we have a URI
list.
* e-component-registry.c
(e_component_registry_peek_info_for_uri_schema): New.
svn path=/trunk/; revision=23461
Diffstat (limited to 'shell/e-shell.c')
-rw-r--r-- | shell/e-shell.c | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c index 84c4ddad85..d84cd4c0d5 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -209,52 +209,26 @@ impl_Shell_handleURI (PortableServer_Servant servant, const CORBA_char *uri, CORBA_Environment *ev) { -#if 0 - EvolutionShellComponentClient *schema_handler; - EShell *shell; - EShellPrivate *priv; + EShell *shell = E_SHELL (bonobo_object_from_servant (servant)); + EComponentInfo *component_info; const char *colon_p; char *schema; - if (raise_exception_if_not_ready (servant, ev)) - return; - - shell = E_SHELL (bonobo_object_from_servant (servant)); - priv = shell->priv; - - if (strncmp (uri, E_SHELL_URI_PREFIX, E_SHELL_URI_PREFIX_LEN) == 0 - || strncmp (uri, E_SHELL_DEFAULTURI_PREFIX, E_SHELL_DEFAULTURI_PREFIX_LEN) == 0) { - e_shell_create_window (shell, NULL, NULL); - return; - } - - /* Extract the schema. */ - colon_p = strchr (uri, ':'); - if (colon_p == NULL || colon_p == uri) { - CORBA_exception_set (ev, CORBA_USER_EXCEPTION, - ex_GNOME_Evolution_Shell_InvalidURI, NULL); - return; - } + if (colon_p == NULL) + schema = g_strdup (uri); + else + schema = g_strndup (uri, colon_p - uri); - schema = g_strndup (uri, colon_p - uri); - schema_handler = e_uri_schema_registry_get_handler_for_schema (priv->uri_schema_registry, schema); + component_info = e_component_registry_peek_info_for_uri_schema (shell->priv->component_registry, schema); g_free (schema); - if (schema_handler == NULL) { - CORBA_exception_set (ev, CORBA_USER_EXCEPTION, - ex_GNOME_Evolution_Shell_UnsupportedSchema, NULL); + if (component_info == NULL) { + CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Shell_UnsupportedSchema, NULL); return; } - if (evolution_shell_component_client_handle_external_uri (schema_handler, uri) - != EVOLUTION_SHELL_COMPONENT_OK) { - /* FIXME: Just a wild guess here. */ - CORBA_exception_set (ev, CORBA_USER_EXCEPTION, - ex_GNOME_Evolution_Shell_NotFound, NULL); - return; - } -#endif + GNOME_Evolution_Component_handleURI (component_info->iface, uri, ev); } static void |