aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-uri-schema-registry.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-10-06 01:49:35 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-10-06 01:49:35 +0800
commitfc1e5673bb9d91f89a851262cf5c66b50c31c18d (patch)
tree042f340229e4ee6f196cc21fbb94a90ec16601b2 /shell/e-uri-schema-registry.c
parenta1750a292eb31a113a22c0278fb6517d56f78f75 (diff)
downloadgsoc2013-evolution-fc1e5673bb9d91f89a851262cf5c66b50c31c18d.tar.gz
gsoc2013-evolution-fc1e5673bb9d91f89a851262cf5c66b50c31c18d.tar.zst
gsoc2013-evolution-fc1e5673bb9d91f89a851262cf5c66b50c31c18d.zip
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
Diffstat (limited to 'shell/e-uri-schema-registry.c')
-rw-r--r--shell/e-uri-schema-registry.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/shell/e-uri-schema-registry.c b/shell/e-uri-schema-registry.c
index 1136cb92a6..a30b9950ee 100644
--- a/shell/e-uri-schema-registry.c
+++ b/shell/e-uri-schema-registry.c
@@ -132,7 +132,7 @@ e_uri_schema_registry_new (void)
}
-gboolean
+void
e_uri_schema_registry_set_handler_for_schema (EUriSchemaRegistry *registry,
const char *schema,
EvolutionShellComponentClient *shell_component)
@@ -141,16 +141,18 @@ e_uri_schema_registry_set_handler_for_schema (EUriSchemaRegistry *registry,
SchemaHandler *existing_handler;
SchemaHandler *new_handler;
- g_return_val_if_fail (registry != NULL, FALSE);
- g_return_val_if_fail (E_IS_URI_SCHEMA_REGISTRY (registry), FALSE);
- g_return_val_if_fail (schema != NULL, FALSE);
- g_return_val_if_fail (shell_component == NULL || EVOLUTION_IS_SHELL_COMPONENT_CLIENT (shell_component), FALSE);
+ g_return_if_fail (registry != NULL);
+ g_return_if_fail (E_IS_URI_SCHEMA_REGISTRY (registry));
+ g_return_if_fail (schema != NULL);
+ g_return_if_fail (shell_component == NULL || EVOLUTION_IS_SHELL_COMPONENT_CLIENT (shell_component));
priv = registry->priv;
existing_handler = g_hash_table_lookup (priv->schema_to_handler, schema);
- if (existing_handler != NULL)
- return FALSE;
+ if (existing_handler != NULL) {
+ g_hash_table_remove (priv->schema_to_handler, existing_handler->schema);
+ schema_handler_free (existing_handler);
+ }
new_handler = schema_handler_new (schema, shell_component);
g_hash_table_insert (priv->schema_to_handler, new_handler->schema, new_handler);