diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2015-04-22 00:46:58 +0100 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2015-04-22 00:55:07 +0100 |
commit | 9c996d5789107fdfc56a3cfff8264a978ac95123 (patch) | |
tree | ac08f09e135d3da72875eee0a132ec43ed0069d9 | |
parent | 727c13a632fbc6a9fd60d9b66921e12b618b55f5 (diff) | |
download | libgdata-9c996d5789107fdfc56a3cfff8264a978ac95123.tar.gz |
app: Remove unused XML parsing code from GDataAPPCategories
No longer needed after porting the YouTube API to v3, which uses JSON.
https://bugzilla.gnome.org/show_bug.cgi?id=687597
-rw-r--r-- | gdata/app/gdata-app-categories.c | 66 |
1 files changed, 1 insertions, 65 deletions
diff --git a/gdata/app/gdata-app-categories.c b/gdata/app/gdata-app-categories.c index aaf7bfa1..6fbf5f67 100644 --- a/gdata/app/gdata-app-categories.c +++ b/gdata/app/gdata-app-categories.c @@ -1,7 +1,7 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* * GData Client - * Copyright (C) Philip Withnall 2010 <philip@tecnocode.co.uk> + * Copyright (C) Philip Withnall 2010, 2015 <philip@tecnocode.co.uk> * * GData Client is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,7 +31,6 @@ #include <config.h> #include <glib.h> -#include <libxml/parser.h> #include "gdata-app-categories.h" #include "atom/gdata-category.h" @@ -41,9 +40,6 @@ static void gdata_app_categories_dispose (GObject *object); static void gdata_app_categories_finalize (GObject *object); static void gdata_app_categories_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); -static gboolean pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error); -static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); -static gboolean post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error); static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error); @@ -74,10 +70,6 @@ gdata_app_categories_class_init (GDataAPPCategoriesClass *klass) gobject_class->dispose = gdata_app_categories_dispose; gobject_class->finalize = gdata_app_categories_finalize; - parsable_class->pre_parse_xml = pre_parse_xml; - parsable_class->parse_xml = parse_xml; - parsable_class->post_parse_xml = post_parse_xml; - parsable_class->parse_json = parse_json; parsable_class->post_parse_json = post_parse_json; @@ -148,62 +140,6 @@ gdata_app_categories_get_property (GObject *object, guint property_id, GValue *v } } -static gboolean -pre_parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *root_node, gpointer user_data, GError **error) -{ - GDataAPPCategoriesPrivate *priv = GDATA_APP_CATEGORIES (parsable)->priv; - xmlChar *fixed; - - /* Extract fixed and scheme */ - priv->scheme = (gchar*) xmlGetProp (root_node, (xmlChar*) "scheme"); - - fixed = xmlGetProp (root_node, (xmlChar*) "fixed"); - if (xmlStrcmp (fixed, (xmlChar*) "yes") == 0) - priv->fixed = TRUE; - xmlFree (fixed); - - return TRUE; -} - -static void -_gdata_app_categories_add_category (GDataAPPCategories *self, GDataCategory *category) -{ - g_return_if_fail (GDATA_IS_APP_CATEGORIES (self)); - g_return_if_fail (GDATA_IS_CATEGORY (category)); - - /* If the category doesn't have a scheme, make it inherit ours */ - if (gdata_category_get_scheme (category) == NULL) - gdata_category_set_scheme (category, self->priv->scheme); - - self->priv->categories = g_list_prepend (self->priv->categories, g_object_ref (category)); -} - -static gboolean -parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) -{ - gboolean success; - - if (gdata_parser_is_namespace (node, "http://www.w3.org/2005/Atom") == TRUE && - gdata_parser_object_from_element_setter (node, "category", P_REQUIRED, - (user_data == NULL) ? GDATA_TYPE_CATEGORY : GPOINTER_TO_SIZE (user_data), - _gdata_app_categories_add_category, GDATA_APP_CATEGORIES (parsable), &success, error) == TRUE) { - return success; - } - - return GDATA_PARSABLE_CLASS (gdata_app_categories_parent_class)->parse_xml (parsable, doc, node, user_data, error); -} - -static gboolean -post_parse_xml (GDataParsable *parsable, gpointer user_data, GError **error) -{ - GDataAPPCategoriesPrivate *priv = GDATA_APP_CATEGORIES (parsable)->priv; - - /* Reverse our lists of stuff */ - priv->categories = g_list_reverse (priv->categories); - - return TRUE; -} - /* Reference: https://developers.google.com/youtube/v3/docs/videoCategories/list */ static gboolean parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error) |