From 5f2b9d82aa56153290f54600dae53e2b2f1638e9 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 17 Mar 2008 14:28:21 +0000 Subject: First pass at porting to GIO. Completely broken, please bear with me. 2008-03-17 Bastien Nocera * *: First pass at porting to GIO. Completely broken, please bear with me. svn path=/trunk/; revision=81 --- plparse/totem-pl-parser-smil.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'plparse/totem-pl-parser-smil.c') diff --git a/plparse/totem-pl-parser-smil.c b/plparse/totem-pl-parser-smil.c index 7c37ffa..e59c844 100644 --- a/plparse/totem-pl-parser-smil.c +++ b/plparse/totem-pl-parser-smil.c @@ -25,7 +25,7 @@ #ifndef TOTEM_PL_PARSER_MINI #include #include -#include +#include #include "xmlparser.h" #include "totem-pl-parser.h" #include "totemplparser-marshal.h" @@ -147,8 +147,8 @@ parse_smil_entries (TotemPlParser *parser, char *base, xml_node_t *doc) } static TotemPlParserResult -totem_pl_parser_add_smil_with_doc (TotemPlParser *parser, const char *url, - const char *_base, xml_node_t *doc) +totem_pl_parser_add_smil_with_doc (TotemPlParser *parser, GFile *file, + GFile *_base_file, xml_node_t *doc) { TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED; char *base; @@ -159,7 +159,7 @@ totem_pl_parser_add_smil_with_doc (TotemPlParser *parser, const char *url, return TOTEM_PL_PARSER_RESULT_ERROR; } - base = totem_pl_parser_base_url (url); + base = totem_pl_parser_base_url (file); retval = parse_smil_entries (parser, base, doc); @@ -169,25 +169,29 @@ totem_pl_parser_add_smil_with_doc (TotemPlParser *parser, const char *url, } TotemPlParserResult -totem_pl_parser_add_smil (TotemPlParser *parser, const char *url, - const char *_base, gpointer data) +totem_pl_parser_add_smil (TotemPlParser *parser, + GFile *file, + GFile *base_file, gpointer data) { char *contents; - int size; + gsize size; TotemPlParserResult retval; - if (gnome_vfs_read_entire_file (url, &size, &contents) != GNOME_VFS_OK) + if (g_file_load_contents (file, NULL, &contents, &size, NULL, NULL) == FALSE) return TOTEM_PL_PARSER_RESULT_ERROR; - retval = totem_pl_parser_add_smil_with_data (parser, url, - _base, contents, size); + retval = totem_pl_parser_add_smil_with_data (parser, file, + base_file, contents, size); g_free (contents); + return retval; } TotemPlParserResult -totem_pl_parser_add_smil_with_data (TotemPlParser *parser, const char *url, - const char *_base, const char *contents, int size) +totem_pl_parser_add_smil_with_data (TotemPlParser *parser, + GFile *file, + GFile *base_file, + const char *contents, int size) { xml_node_t* doc; TotemPlParserResult retval; @@ -196,7 +200,7 @@ totem_pl_parser_add_smil_with_data (TotemPlParser *parser, const char *url, if (xml_parser_build_tree_with_options (&doc, XML_PARSER_RELAXED | XML_PARSER_MULTI_TEXT) < 0) return TOTEM_PL_PARSER_RESULT_ERROR; - retval = totem_pl_parser_add_smil_with_doc (parser, url, _base, doc); + retval = totem_pl_parser_add_smil_with_doc (parser, file, base_file, doc); xml_parser_free_tree (doc); return retval; -- cgit v1.2.1