From fc1e5673bb9d91f89a851262cf5c66b50c31c18d Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 5 Oct 2001 17:49:35 +0000 Subject: If setting the owner fails, print the a warning message out. Then restart * e-shell.c (set_owner_on_components): If setting the owner fails, print the a warning message out. Then restart the component. * e-component-registry.c (component_free): Return a boolean value. %FALSE if ::unsetOwner raises an exception. (register_type): New arg @override_duplicate, to avoid complaining if a component gets re-registered. (register_component): Likewise. (e_component_registry_restart_component): New. * e-uri-schema-registry.c (e_uri_schema_registry_set_handler_for_schema): Changed return type to `void'. Just remove the old handler and set up the new one. * evolution-shell-component-client.c (corba_exception_to_result): Translate ::OldOwnerHasDied into EVOLUTION_SHELL_COMPONENT_OLDOWNERHASDIED. * evolution-shell-component.h: New enum value `EVOLUTION_SHELL_COMPONENT_OLDOWNERHASDIED'. * evolution-shell-component.c (impl_setOwner): If the old owner is not alive anymore [use CORBA_Object_non_existent() to figure this out], emit OWNER_UNSET and raise `OldOwnerHasDied'. (evolution_shell_component_result_to_string): New. * Evolution-ShellComponent.idl: New exception `OldOwnerHasDied'. (ShellComponent::setOwner): Can raise it. * e-folder-type-registry.c (e_folder_type_register_type_registered): New. (e_folder_type_register_unregister_type): New. svn path=/trunk/; revision=13446 --- shell/e-shell.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'shell/e-shell.c') diff --git a/shell/e-shell.c b/shell/e-shell.c index a1f47ca8b5..bafe7ea2d5 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -686,12 +686,20 @@ set_owner_on_components (EShell *shell) id_list = e_component_registry_get_id_list (priv->component_registry); for (p = id_list; p != NULL; p = p->next) { EvolutionShellComponentClient *component_client; + EvolutionShellComponentResult result; const char *id; id = (const char *) p->data; component_client = e_component_registry_get_component_by_id (priv->component_registry, id); - evolution_shell_component_client_set_owner (component_client, corba_shell, local_directory); + result = evolution_shell_component_client_set_owner (component_client, corba_shell, local_directory); + if (result != EVOLUTION_SHELL_COMPONENT_OK) { + g_warning ("Error setting owner on component %s -- %s", + id, evolution_shell_component_result_to_string (result)); + + if (result == EVOLUTION_SHELL_COMPONENT_OLDOWNERHASDIED) + e_component_registry_restart_component (priv->component_registry, id); + } } e_free_string_list (id_list); -- cgit v1.2.3