aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-uri-schema-registry.c
diff options
context:
space:
mode:
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);