aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-extensions-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ephy-extensions-manager.c')
-rw-r--r--src/ephy-extensions-manager.c100
1 files changed, 1 insertions, 99 deletions
diff --git a/src/ephy-extensions-manager.c b/src/ephy-extensions-manager.c
index 8f01e4f2b..661889e54 100644
--- a/src/ephy-extensions-manager.c
+++ b/src/ephy-extensions-manager.c
@@ -47,13 +47,6 @@
#include <dirent.h>
#include <string.h>
-/* define to validate the extensions files */
-/* #define ENABLE_VALIDATION */
-
-#ifdef ENABLE_VALIDATION
-#include <libxml/xmlschemas.h>
-#endif
-
#ifdef ENABLE_PYTHON
#include "ephy-python-extension.h"
#include "ephy-python-loader.h"
@@ -74,11 +67,6 @@ struct _EphyExtensionsManagerPrivate
GList *dir_monitors;
GList *windows;
guint active_extensions_notifier_id;
-
-#ifdef ENABLE_VALIDATION
- xmlSchemaPtr schema;
- xmlSchemaValidCtxtPtr schema_ctxt;
-#endif
};
typedef struct
@@ -400,19 +388,7 @@ ephy_extensions_manager_load_xml_string (EphyExtensionsManager *manager,
g_warning ("Couldn't read '%s' data\n", identifier);
return;
}
-#ifdef ENABLE_VALIDATION
- /* Validate the extension description */
- if (manager->priv->schema_ctxt)
- {
- if (xmlSchemaValidateDoc (manager->priv->schema_ctxt, doc))
- {
- g_warning ("Validation errors in '%s' data",
- identifier);
- xmlFreeDoc (doc);
- return;
- }
- }
-#endif
+
/* Now parse it */
reader = xmlReaderWalker (doc);
g_return_if_fail (reader != NULL);
@@ -1347,65 +1323,6 @@ active_extensions_notifier (GConfClient *client,
sync_loaded_extensions (manager);
}
-#ifdef ENABLE_VALIDATION
-static void
-xml_error_cb (EphyExtensionsManager *manager,
- const char *msg,
- ...)
-
-{
- va_list args;
-
- va_start (args, msg);
- g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, msg, args);
- va_end(args);
-}
-
-static void
-init_schema_ctxt (EphyExtensionsManager *manager)
-{
- xmlSchemaParserCtxtPtr parse_ctxt;
- const char *filename;
-
- manager->priv->schema = NULL;
- manager->priv->schema_ctxt = NULL;
-
- filename = ephy_file (SCHEMA_FILE);
- g_return_if_fail (filename != NULL);
-
- parse_ctxt = xmlSchemaNewParserCtxt (filename);
- if (parse_ctxt == NULL)
- {
- g_warning ("Error opening extensions description schema file "
- "\"" SCHEMA_FILE "\"");
- return;
- }
-
- manager->priv->schema = xmlSchemaParse (parse_ctxt);
- xmlSchemaFreeParserCtxt (parse_ctxt);
- if (manager->priv->schema == NULL)
- {
- g_warning ("Error parsing extensions description schema file "
- "\"" SCHEMA_FILE "\"");
- return;
- }
-
- manager->priv->schema_ctxt = xmlSchemaNewValidCtxt
- (manager->priv->schema);
- if (manager->priv->schema == NULL)
- {
- g_warning ("Error creating extensions description schema "
- "validation context for \"" SCHEMA_FILE "\"");
- return;
- }
-
- xmlSchemaSetValidErrors (manager->priv->schema_ctxt,
- (xmlSchemaValidityErrorFunc) xml_error_cb,
- (xmlSchemaValidityWarningFunc) xml_error_cb,
- manager);
-}
-#endif
-
static void
ephy_extensions_manager_init (EphyExtensionsManager *manager)
{
@@ -1423,10 +1340,6 @@ ephy_extensions_manager_startup (EphyExtensionsManager *manager)
LOG ("EphyExtensionsManager startup");
-#ifdef ENABLE_VALIDATION
- init_schema_ctxt (manager);
-#endif
-
/* load the extensions descriptions */
path = g_build_filename (ephy_dot_dir (), "extensions", NULL);
ephy_extensions_manager_load_dir (manager, path);
@@ -1467,17 +1380,6 @@ ephy_extensions_manager_finalize (GObject *object)
g_list_free (priv->windows);
-#ifdef ENABLE_VALIDATION
- if (priv->schema)
- {
- xmlSchemaFree (priv->schema);
- }
- if (priv->schema_ctxt)
- {
- xmlSchemaFreeValidCtxt (priv->schema_ctxt);
- }
-#endif
-
parent_class->finalize (object);
}