Index: configure.in
===================================================================
--- configure.in	(revision 42)
+++ configure.in	(working copy)
@@ -77,7 +77,7 @@
 AM_CONDITIONAL(HAVE_HAL, test x"$with_hal" = xyes)
 
 dnl Check for packages for building libtotem-plparser.la
-PKG_CHECK_MODULES(TOTEM_PLPARSER, [glib-2.0 >= $GLIB_REQS gtk+-2.0 libxml-2.0 gnome-vfs-2.0 >= $GNOMEVFS_REQS gnome-vfs-module-2.0 camel-1.2])
+PKG_CHECK_MODULES(TOTEM_PLPARSER, [glib-2.0 >= $GLIB_REQS gtk+-2.0 libxml-2.0 gnome-vfs-2.0 >= $GNOMEVFS_REQS gnome-vfs-module-2.0 camel-1.2 gio-2.0])
 
 PKG_CHECK_MODULES([TOTEM_PLPARSER_MINI], [gnome-vfs-2.0 gnome-vfs-module-2.0])
 
Index: plparse/totem-pl-parser-pla.c
===================================================================
--- plparse/totem-pl-parser-pla.c	(revision 41)
+++ plparse/totem-pl-parser-pla.c	(working copy)
@@ -89,7 +89,7 @@
 	strncpy (buffer + TITLE_OFFSET, title, TITLE_SIZE);
 	if (totem_pl_parser_write_buffer (handle, buffer, RECORD_SIZE, error) == FALSE)
 	{
-		DEBUG(g_print ("Couldn't write header block"));
+		DEBUG(NULL, g_print ("Couldn't write header block"));
 		gnome_vfs_close (handle);
 		g_free (buffer);
 		return FALSE;
@@ -118,7 +118,7 @@
 		path = g_filename_from_uri (uri, NULL, error);
 		if (path == NULL)
 		{
-			DEBUG(g_print ("Couldn't convert URI '%s' to a filename: %s\n", uri, (*error)->message));
+			DEBUG(NULL, g_print ("Couldn't convert URI '%s' to a filename: %s\n", uri, (*error)->message));
 			g_free (uri);
 			ret = FALSE;
 			break;
@@ -132,7 +132,7 @@
 		converted = g_convert (path, -1, "UTF-16BE", "UTF-8", NULL, &written, error);
 		if (converted == NULL)
 		{
-			DEBUG(g_print ("Couldn't convert filename '%s' to UTF-16BE\n", path));
+			DEBUG(NULL, g_print ("Couldn't convert filename '%s' to UTF-16BE\n", path));
 			g_free (path);
 			ret = FALSE;
 			break;
@@ -147,7 +147,7 @@
 
 		if (totem_pl_parser_write_buffer (handle, buffer, RECORD_SIZE, error) == FALSE)
 		{
-			DEBUG(g_print ("Couldn't write entry %d to the file\n", i));
+			DEBUG(NULL, g_print ("Couldn't write entry %d to the file\n", i));
 			ret = FALSE;
 			break;
 		}
@@ -159,9 +159,12 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_pla (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_pla (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *base_file,
+			 gpointer data)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents, *title;
 	int size, offset, max_entries, entry;
@@ -243,6 +246,7 @@
 	g_free (contents);
 
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
+#endif
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-private.h
===================================================================
--- plparse/totem-pl-parser-private.h	(revision 46)
+++ plparse/totem-pl-parser-private.h	(working copy)
@@ -29,6 +29,8 @@
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
 #include <glib-object.h>
+#include <gio/gio.h>
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
@@ -46,7 +48,26 @@
 #define ASX_MIME_TYPE "audio/x-ms-asx"
 #define ASF_REF_MIME_TYPE "video/x-ms-asf"
 
+#define TOTEM_PL_PARSER_FIELD_FILE		"gfile-object"
+
+#ifndef TOTEM_PL_PARSER_MINI
+#define DEBUG(file, x) {					\
+	if (parser->priv->debug) {				\
+		if (file != NULL) {				\
+			char *uri;				\
+								\
+			uri = g_file_get_uri (file);		\
+			x;					\
+			g_free (uri);				\
+		} else {					\
+			const char *uri = "empty";		\
+			x;					\
+		}						\
+	}							\
+}
+#else
 #define DEBUG(x) { if (parser->priv->debug) x; }
+#endif
 
 struct TotemPlParserPrivate
 {
@@ -61,14 +82,13 @@
 	guint disable_unsafe : 1;
 };
 
+#ifndef TOTEM_PL_PARSER_MINI
 char *totem_pl_parser_read_ini_line_string	(char **lines, const char *key,
 						 gboolean dos_mode);
 int   totem_pl_parser_read_ini_line_int		(char **lines, const char *key);
 char *totem_pl_parser_read_ini_line_string_with_sep (char **lines, const char *key,
 						     gboolean dos_mode, const char *sep);
-char *totem_pl_parser_base_url			(const char *url);
-
-#ifndef TOTEM_PL_PARSER_MINI
+char *totem_pl_parser_base_url			(GFile *file);
 void totem_pl_parser_playlist_end		(TotemPlParser *parser,
 						 const char *playlist_title);
 int totem_pl_parser_num_entries			(TotemPlParser *parser,
@@ -76,23 +96,26 @@
 						 TotemPlParserIterFunc func,
 						 gpointer user_data);
 gboolean totem_pl_parser_scheme_is_ignored	(TotemPlParser *parser,
-						 const char *url);
+						 GFile *file);
 gboolean totem_pl_parser_line_is_empty		(const char *line);
-gboolean totem_pl_parser_write_string		(GnomeVFSHandle *handle,
+gboolean totem_pl_parser_write_string		(GOutputStream *stream,
 						 const char *buf,
 						 GError **error);
-gboolean totem_pl_parser_write_buffer		(GnomeVFSHandle *handle,
+gboolean totem_pl_parser_write_buffer		(GOutputStream *stream,
 						 const char *buf,
 						 guint size,
 						 GError **error);
 char * totem_pl_parser_relative			(const char *url,
 						 const char *output);
 TotemPlParserResult totem_pl_parser_parse_internal (TotemPlParser *parser,
-						    const char *url,
-						    const char *base);
+						    GFile *file,
+						    GFile *base_file);
 void totem_pl_parser_add_one_url		(TotemPlParser *parser,
 						 const char *url,
 						 const char *title);
+void totem_pl_parser_add_one_file		(TotemPlParser *parser,
+						 GFile *file,
+						 const char *title);
 void totem_pl_parser_add_url			(TotemPlParser *parser,
 						 const char *first_property_name,
 						 ...);
Index: plparse/totem-pl-parser-media.c
===================================================================
--- plparse/totem-pl-parser-media.c	(revision 41)
+++ plparse/totem-pl-parser-media.c	(working copy)
@@ -40,8 +40,10 @@
 /* Returns NULL if we don't have an ISO image,
  * or an empty string if it's non-UTF-8 data */
 static char *
-totem_pl_parser_iso_get_title (const char *url)
+totem_pl_parser_iso_get_title (GFile *file)
 {
+	//FIXME
+#if 0
 	char *fname;
 	FILE  *file;
 #define BUFFER_SIZE 128
@@ -107,20 +109,25 @@
 	}
 
 	return str;
+#endif
+	return NULL;
 }
 
 TotemPlParserResult
-totem_pl_parser_add_iso (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_iso (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *base_file,
+			 gpointer data)
 {
-	GnomeVFSFileInfo *info;
+	GFileInfo *info;
+//	GnomeVFSFileInfo *info;
 	char *item, *label;
 
 	/* This is a hack, it could be a VCD or DVD */
-	if (g_str_has_prefix (url, "file://") == FALSE)
+	if (g_file_has_uri_scheme (file, "file") == FALSE)
 		return TOTEM_PL_PARSER_RESULT_IGNORED;
 
-	label = totem_pl_parser_iso_get_title (url);
+	label = totem_pl_parser_iso_get_title (file);
 	if (label == NULL) {
 		/* Not an ISO image */
 		return TOTEM_PL_PARSER_RESULT_UNHANDLED;
@@ -130,32 +137,36 @@
 		label = NULL;
 	}
 
-	info = gnome_vfs_file_info_new ();
-	if (gnome_vfs_get_file_info (url, info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS) != GNOME_VFS_OK) {
-		gnome_vfs_file_info_unref (info);
+	info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_SIZE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
+	if (info == NULL) {
+		g_free (label);
 		return TOTEM_PL_PARSER_RESULT_IGNORED;
 	}
 
+#if 0
 	/* Less than 700 megs, and it's a VCD */
-	if (info->size < 700 * 1024 * 1024) {
+	if (g_file_info_get_size (info) < 700 * 1024 * 1024) {
 		item = totem_cd_mrl_from_type ("vcd", url);
 	} else {
 		item = totem_cd_mrl_from_type ("dvd", url);
 	}
-
-	gnome_vfs_file_info_unref (info);
-
+#endif
+	g_object_unref (info);
+#if 0
 	totem_pl_parser_add_one_url (parser, item, label);
+#endif
 	g_free (label);
-	g_free (item);
+//	g_free (item);
 
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 TotemPlParserResult
-totem_pl_parser_add_cue (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_cue (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *base_file, gpointer data)
 {
+#if 0
 	char *vcdurl;
 
 	vcdurl = totem_cd_mrl_from_type ("vcd", url);
@@ -163,6 +174,7 @@
 	g_free (vcdurl);
 
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
+#endif
 }
 
 static int
@@ -182,9 +194,12 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_directory (TotemPlParser *parser, const char *url,
-			       const char *base, gpointer data)
+totem_pl_parser_add_directory (TotemPlParser *parser,
+			       GFile *file,
+			       GFile *base_file,
+			       gpointer data)
 {
+#if 0
 	TotemDiscMediaType type;
 	GList *list, *l;
 	GnomeVFSResult res;
@@ -241,12 +256,16 @@
 	g_list_free (list);
 
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_block (TotemPlParser *parser, const char *url,
-			   const char *base, gpointer data)
+totem_pl_parser_add_block (TotemPlParser *parser,
+			   GFile *file,
+			   GFile *base_file,
+			   gpointer data)
 {
+#if 0
 	TotemDiscMediaType type;
 	char *media_url;
 	GError *err = NULL;
@@ -264,6 +283,7 @@
 	totem_pl_parser_add_one_url (parser, media_url, NULL);
 	g_free (media_url);
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
+#endif
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/test-parser.c
===================================================================
--- plparse/test-parser.c	(revision 41)
+++ plparse/test-parser.c	(working copy)
@@ -3,11 +3,12 @@
 #include <locale.h>
 
 #include <glib.h>
+#include <gio/gio.h>
+
 #include <string.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <time.h>
-#include <libgnomevfs/gnome-vfs.h>
 
 #include "totem-pl-parser.h"
 #include "totem-pl-parser-mini.h"
@@ -117,6 +118,7 @@
 {
 	header ("Resolve URL");
 
+	test_resolve_real ("http://localhost:12345/foobar/", "another_file", "http://localhost:12345/foobar/another_file");
 	test_resolve_real ("http://localhost:12345/foobar", "/leopard.mov", "http://localhost:12345/leopard.mov");
 	test_resolve_real ("file:///home/hadess/Movies", "Movies/mymovie.mov", "file:///home/hadess/Movies/Movies/mymovie.mov");
 	test_resolve_real ("http://localhost/video.dir/video.mpg?param1=foo&param2=bar", "dir/image.jpg", "http://localhost/video.dir/dir/image.jpg");
@@ -293,62 +295,43 @@
 static char *
 test_data_get_data (const char *uri, guint *len)
 {
-	GnomeVFSResult result;
-	GnomeVFSHandle *handle;
+	gssize bytes_read;
+	GFileInputStream *stream;
+	GFile *file;
+	GError *error = NULL;
 	char *buffer;
-	GnomeVFSFileSize total_bytes_read;
-	GnomeVFSFileSize bytes_read;
 
 	*len = 0;
 
+	file = g_file_new_for_uri (uri);
+
 	/* Open the file. */
-	result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
-	if (result != GNOME_VFS_OK)
+	stream = g_file_read (file, NULL, &error);
+	if (stream == NULL) {
+		g_print ("URL '%s' couldn't be opened in test_data_get_data: '%s'\n", uri, error->message);
+		g_error_free (error);
 		return NULL;
+	}
 
-	/* Read the whole thing, up to MIME_READ_CHUNK_SIZE */
-	buffer = NULL;
-	total_bytes_read = 0;
-	do {
-		buffer = g_realloc (buffer, total_bytes_read
-				+ MIME_READ_CHUNK_SIZE);
-		result = gnome_vfs_read (handle,
-				buffer + total_bytes_read,
-				MIME_READ_CHUNK_SIZE,
-				&bytes_read);
-		if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
-			g_free (buffer);
-			gnome_vfs_close (handle);
-			return NULL;
-		}
+	buffer = g_malloc (MIME_READ_CHUNK_SIZE);
+	bytes_read = g_input_stream_read (G_INPUT_STREAM (stream), buffer, MIME_READ_CHUNK_SIZE, NULL, &error);
+	g_input_stream_close (G_INPUT_STREAM (stream), NULL, NULL);
+	if (bytes_read == -1) {
+		g_free (buffer);
+		return NULL;
+	}
 
-		/* Check for overflow. */
-		if (total_bytes_read + bytes_read < total_bytes_read) {
-			g_free (buffer);
-			gnome_vfs_close (handle);
-			return NULL;
-		}
-
-		total_bytes_read += bytes_read;
-	} while (result == GNOME_VFS_OK
-			&& total_bytes_read < MIME_READ_CHUNK_SIZE);
-
-	/* Close the file but don't overwrite the possible error */
-	if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF)
-		gnome_vfs_close (handle);
-	else
-		result = gnome_vfs_close (handle);
-
-	if (result != GNOME_VFS_OK) {
-		g_message ("URL '%s' couldn't be read or closed in _get_mime_type_with_data: '%s'\n", uri, gnome_vfs_result_to_string (result));
+	if (bytes_read == -1) {
+		g_message ("URL '%s' couldn't be read or closed in _get_mime_type_with_data: '%s'\n", uri, error->message);
+		g_error_free (error);
 		g_free (buffer);
 		return NULL;
 	}
 
 	/* Return the file null-terminated. */
-	buffer = g_realloc (buffer, total_bytes_read + 1);
-	buffer[total_bytes_read] = '\0';
-	*len = total_bytes_read;
+	buffer = g_realloc (buffer, bytes_read + 1);
+	buffer[bytes_read] = '\0';
+	*len = bytes_read;
 
 	return buffer;
 }
@@ -442,6 +425,7 @@
 	setlocale (LC_ALL, "");
 
 	g_thread_init (NULL);
+	g_type_init ();
 
 	context = g_option_context_new (NULL);
 	g_option_context_add_main_entries (context, option_entries, NULL);
@@ -457,8 +441,6 @@
 		exit (1);
 	}
 
-	gnome_vfs_init();
-
 	if (g_fatal_warnings) {
 		GLogLevelFlags fatal_mask;
 
@@ -491,9 +473,9 @@
 
 	if (files == NULL) {
 		test_duration ();
-		test_resolve ();
-		test_relative ();
 		test_date ();
+		test_relative ();
+		test_resolve ();
 		test_parsing ();
 	} else {
 		if (option_data) {
Index: plparse/totem-pl-parser-pla.h
===================================================================
--- plparse/totem-pl-parser-pla.h	(revision 41)
+++ plparse/totem-pl-parser-pla.h	(working copy)
@@ -25,9 +25,10 @@
 
 G_BEGIN_DECLS
 
-#ifdef TOTEM_PL_PARSER_MINI
-#include "totem-pl-parser-mini.h"
-#endif /* TOTEM_PL_PARSER_MINI */
+#ifndef TOTEM_PL_PARSER_MINI
+#include "totem-pl-parser.h"
+#include <gio/gio.h>
+#endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 gboolean totem_pl_parser_write_pla				(TotemPlParser *parser,
@@ -38,8 +39,8 @@
 								 gpointer user_data,
 								 GError **error);
 TotemPlParserResult totem_pl_parser_add_pla			(TotemPlParser *parser,
-								 const char *url,
-								 const char *base,
+								 GFile *file,
+								 GFile *base_file,
 								 gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-media.h
===================================================================
--- plparse/totem-pl-parser-media.h	(revision 41)
+++ plparse/totem-pl-parser-media.h	(working copy)
@@ -27,24 +27,25 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_iso (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_cue (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_directory (TotemPlParser *parser,
-						   const char *url,
-						   const char *base,
+						   GFile *file,
+						   GFile *base_file,
 						   gpointer data);
 TotemPlParserResult totem_pl_parser_add_block (TotemPlParser *parser,
-					       const char *url,
-					       const char *base,
+					       GFile *file,
+					       GFile *base_file,
 					       gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-misc.c
===================================================================
--- plparse/totem-pl-parser-misc.c	(revision 41)
+++ plparse/totem-pl-parser-misc.c	(working copy)
@@ -42,9 +42,12 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult
-totem_pl_parser_add_gvp (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_gvp (TotemPlParser *parser,
+			 GFile *url,
+			 GFile *base_file,
+			 gpointer data)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents, **lines, *title, *link, *version;
 	int size;
@@ -86,12 +89,16 @@
 	g_strfreev (lines);
 
 	return retval;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_desktop (TotemPlParser *parser, const char *url,
-			     const char *base, gpointer data)
+totem_pl_parser_add_desktop (TotemPlParser *parser,
+			     GFile *file,
+			     GFile *base_file,
+			     gpointer data)
 {
+#if 0
 	char *contents, **lines;
 	const char *path, *display_name, *type;
 	int size;
@@ -132,6 +139,7 @@
 	g_strfreev (lines);
 
 	return res;
+#endif
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-podcast.c
===================================================================
--- plparse/totem-pl-parser-podcast.c	(revision 46)
+++ plparse/totem-pl-parser-podcast.c	(working copy)
@@ -235,10 +235,11 @@
 
 TotemPlParserResult
 totem_pl_parser_add_rss (TotemPlParser *parser,
-			 const char *url,
-			 const char *base,
+			 GFile *file,
+			 GFile *base_file,
 			 gpointer data)
 {
+#if 0
 	xml_node_t* doc, *channel;
 	char *contents;
 	int size;
@@ -269,17 +270,18 @@
 
 	g_free (contents);
 	xml_parser_free_tree (doc);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 /* http://www.apple.com/itunes/store/podcaststechspecs.html */
 TotemPlParserResult
 totem_pl_parser_add_itpc (TotemPlParser *parser,
-			  const char *url,
-			  const char *base,
+			  GFile *file,
+			  GFile *base_file,
 			  gpointer data)
 {
+#if 0
 	TotemPlParserResult ret;
 	char *new_url;
 
@@ -289,6 +291,7 @@
 	g_free (new_url);
 
 	return ret;
+#endif
 }
 
 /* Atom docs:
@@ -423,10 +426,11 @@
 
 TotemPlParserResult
 totem_pl_parser_add_atom (TotemPlParser *parser,
-			  const char *url,
-			  const char *base,
+			  GFile *file,
+			  GFile *base_file,
 			  gpointer data)
 {
+#if 0
 	xml_node_t* doc;
 	char *contents;
 	int size;
@@ -451,14 +455,14 @@
 
 	g_free (contents);
 	xml_parser_free_tree (doc);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 TotemPlParserResult
 totem_pl_parser_add_xml_feed (TotemPlParser *parser,
-			      const char *url,
-			      const char *base,
+			      GFile *file,
+			      GFile *base_file,
 			      gpointer data)
 {
 	guint len;
@@ -469,11 +473,11 @@
 	len = strlen (data);
 
 	if (totem_pl_parser_is_rss (data, len) != FALSE)
-		return totem_pl_parser_add_rss (parser, url, base, data);
+		return totem_pl_parser_add_rss (parser, file, base_file, data);
 	if (totem_pl_parser_is_atom (data, len) != FALSE)
-		return totem_pl_parser_add_atom (parser, url, base, data);
+		return totem_pl_parser_add_atom (parser, file, base_file, data);
 	if (totem_pl_parser_is_opml (data, len) != FALSE)
-		return totem_pl_parser_add_opml (parser, url, base, data);
+		return totem_pl_parser_add_opml (parser, file, base_file, data);
 
 	return TOTEM_PL_PARSER_RESULT_UNHANDLED;
 }
@@ -642,10 +646,11 @@
 
 TotemPlParserResult
 totem_pl_parser_add_itms (TotemPlParser *parser,
-			  const char *url,
-			  const char *base,
+			  GFile *file,
+			  GFile *base_file,
 			  gpointer data)
 {
+#if 0
 	char *contents, *uncompressed, *itms_url, *feed_url;
 	TotemPlParserResult ret;
 	int size;
@@ -689,14 +694,16 @@
 	g_free (feed_url);
 
 	return ret;
+#endif
 }
 
 gboolean
-totem_pl_parser_is_itms_feed (const char *url)
+totem_pl_parser_is_itms_feed (GFile *file)
 {
+#if 0
 	g_return_val_if_fail (url != NULL, FALSE);
 
-	if (g_str_has_prefix (url, "itms:") != FALSE
+	if (g_file_has_uri_scheme (file, "itms:") != FALSE
 	    && strstr (url, "phobos.apple.com") != NULL
 	    && strstr (url, "viewPodcast") != NULL)
 		return TRUE;
@@ -705,7 +712,7 @@
 		return TRUE;
 	if (strstr (url, "itunes.com/podcast") != NULL)
 		return TRUE;
-
+#endif
 	return FALSE;
 }
 
@@ -766,10 +773,11 @@
 
 TotemPlParserResult
 totem_pl_parser_add_opml (TotemPlParser *parser,
-			  const char *url,
-			  const char *base,
+			  GFile *file,
+			  GFile *base_file,
 			  gpointer data)
 {
+#if 0
 	xml_node_t* doc;
 	char *contents;
 	int size;
@@ -794,7 +802,7 @@
 
 	g_free (contents);
 	xml_parser_free_tree (doc);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
Index: plparse/totem-pl-parser-pls.c
===================================================================
--- plparse/totem-pl-parser-pls.c	(revision 41)
+++ plparse/totem-pl-parser-pls.c	(working copy)
@@ -148,9 +148,12 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_pls_with_contents (TotemPlParser *parser, const char *url,
-				       const char *base, const char *contents)
+totem_pl_parser_add_pls_with_contents (TotemPlParser *parser,
+				       GFile *file,
+				       GFile *base_file,
+				       const char *contents)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char **lines;
 	int i, num_entries;
@@ -299,12 +302,16 @@
 	g_strfreev (lines);
 
 	return retval;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_pls (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_pls (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *base_file,
+			 gpointer data)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents;
 	int size;
@@ -321,6 +328,7 @@
 	g_free (contents);
 
 	return retval;
+#endif
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-misc.h
===================================================================
--- plparse/totem-pl-parser-misc.h	(revision 41)
+++ plparse/totem-pl-parser-misc.h	(working copy)
@@ -27,18 +27,19 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_gvp (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_desktop (TotemPlParser *parser,
-						 const char *url,
-						 const char *base,
+						 GFile *file,
+						 GFile *base_file,
 						 gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-podcast.h
===================================================================
--- plparse/totem-pl-parser-podcast.h	(revision 46)
+++ plparse/totem-pl-parser-podcast.h	(working copy)
@@ -26,6 +26,7 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
@@ -36,31 +37,31 @@
 const char * totem_pl_parser_is_xml_feed (const char *data, gsize len);
 
 #ifndef TOTEM_PL_PARSER_MINI
-gboolean totem_pl_parser_is_itms_feed (const char *url);
+gboolean totem_pl_parser_is_itms_feed (GFile *file);
 
 TotemPlParserResult totem_pl_parser_add_xml_feed (TotemPlParser *parser,
-						  const char *url,
-						  const char *base,
+						  GFile *file,
+						  GFile *base_file,
 						  gpointer data);
 TotemPlParserResult totem_pl_parser_add_atom (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 TotemPlParserResult totem_pl_parser_add_rss (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_itpc (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 TotemPlParserResult totem_pl_parser_add_itms (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 TotemPlParserResult totem_pl_parser_add_opml (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-pls.h
===================================================================
--- plparse/totem-pl-parser-pls.h	(revision 41)
+++ plparse/totem-pl-parser-pls.h	(working copy)
@@ -25,9 +25,10 @@
 
 G_BEGIN_DECLS
 
-#ifdef TOTEM_PL_PARSER_MINI
-#include "totem-pl-parser-mini.h"
-#endif /* TOTEM_PL_PARSER_MINI */
+#ifndef TOTEM_PL_PARSER_MINI
+#include "totem-pl-parser.h"
+#include <gio/gio.h>
+#endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 gboolean totem_pl_parser_write_pls				(TotemPlParser *parser,
@@ -38,12 +39,12 @@
 								 gpointer user_data,
 								 GError **error);
 TotemPlParserResult totem_pl_parser_add_pls_with_contents	(TotemPlParser *parser,
-								 const char *url,
-								 const char *base,
+								 GFile *file,
+								 GFile *base_file,
 								 const char *contents);
 TotemPlParserResult totem_pl_parser_add_pls			(TotemPlParser *parser,
-								 const char *url,
-								 const char *base,
+								 GFile *file,
+								 GFile *base_file,
 								 gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-smil.c
===================================================================
--- plparse/totem-pl-parser-smil.c	(revision 41)
+++ plparse/totem-pl-parser-smil.c	(working copy)
@@ -25,7 +25,7 @@
 #ifndef TOTEM_PL_PARSER_MINI
 #include <glib.h>
 #include <gtk/gtk.h>
-#include <libgnomevfs/gnome-vfs.h>
+#include <gio/gio.h>
 #include "xmlparser.h"
 #include "totem-pl-parser.h"
 #include "totemplparser-marshal.h"
@@ -147,8 +147,8 @@
 }
 
 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 @@
 		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 @@
 }
 
 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 @@
 	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;
Index: plparse/totem-pl-parser-smil.h
===================================================================
--- plparse/totem-pl-parser-smil.h	(revision 41)
+++ plparse/totem-pl-parser-smil.h	(working copy)
@@ -27,18 +27,19 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_smil (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 TotemPlParserResult totem_pl_parser_add_smil_with_data (TotemPlParser *parser,
-							const char *url,
-							const char *base,
+							GFile *file,
+							GFile *base_file,
 							const char *contents,
 							int size);
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-lines.c
===================================================================
--- plparse/totem-pl-parser-lines.c	(revision 46)
+++ plparse/totem-pl-parser-lines.c	(working copy)
@@ -28,7 +28,8 @@
 #ifndef TOTEM_PL_PARSER_MINI
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
-#include <libgnomevfs/gnome-vfs.h>
+#include <gio/gio.h>
+
 #include "totem-pl-parser.h"
 #include "totemplparser-marshal.h"
 #include "totem-pl-parser-pls.h"
@@ -77,33 +78,23 @@
 
 gboolean
 totem_pl_parser_write_m3u (TotemPlParser *parser, GtkTreeModel *model,
-		TotemPlParserIterFunc func, const char *output,
-		gboolean dos_compatible, gpointer user_data, GError **error)
+			   TotemPlParserIterFunc func, const char *output,
+			   gboolean dos_compatible, gpointer user_data, GError **error)
 {
-	GnomeVFSHandle *handle;
-	GnomeVFSResult res;
+	GFile *out;
+	GFileOutputStream *stream;
 	int num_entries_total, i;
 	gboolean success;
 	char *buf;
 	char *cr;
 
-	res = gnome_vfs_open (&handle, output, GNOME_VFS_OPEN_WRITE);
-	if (res == GNOME_VFS_ERROR_NOT_FOUND) {
-		res = gnome_vfs_create (&handle, output,
-				GNOME_VFS_OPEN_WRITE, FALSE,
-				GNOME_VFS_PERM_USER_WRITE
-				| GNOME_VFS_PERM_USER_READ
-				| GNOME_VFS_PERM_GROUP_READ);
-	}
-
-	if (res != GNOME_VFS_OK) {
-		g_set_error(error,
-			    TOTEM_PL_PARSER_ERROR,
-			    TOTEM_PL_PARSER_ERROR_VFS_OPEN,
-			    _("Couldn't open file '%s': %s"),
-			    output, gnome_vfs_result_to_string (res));
+	out = g_file_new_for_commandline_arg (output);
+	stream = g_file_replace (out, NULL, FALSE, G_FILE_CREATE_NONE, NULL, error);
+	if (stream == NULL) {
+		g_object_unref (out);
 		return FALSE;
 	}
+	g_object_unref (out);
 
 	cr = dos_compatible ? "\r\n" : "\n";
 	num_entries_total = gtk_tree_model_iter_n_children (model, NULL);
@@ -114,27 +105,30 @@
 		GtkTreeIter iter;
 		char *url, *title, *path2;
 		gboolean custom_title;
+		GFile *file;
 
 		if (gtk_tree_model_iter_nth_child (model, &iter, NULL, i - 1) == FALSE)
 			continue;
 
 		func (model, &iter, &url, &title, &custom_title, user_data);
 
-		if (totem_pl_parser_scheme_is_ignored (parser, url) != FALSE)
-		{
+		file = g_file_new_for_uri (url);
+		if (totem_pl_parser_scheme_is_ignored (parser, file) != FALSE) {
+			g_object_unref (file);
 			g_free (url);
 			g_free (title);
 			continue;
 		}
+		g_object_unref (file);
 
 		if (custom_title != FALSE) {
 			buf = g_strdup_printf (EXTINF",%s%s", title, cr);
-			success = totem_pl_parser_write_string (handle, buf, error);
+			success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf, error);
 			g_free (buf);
 			if (success == FALSE) {
 				g_free (title);
 				g_free (url);
-				gnome_vfs_close (handle);
+				g_output_stream_close (G_OUTPUT_STREAM (stream), NULL, NULL);
 				return FALSE;
 			}
 		}
@@ -156,17 +150,16 @@
 		g_free (path2);
 		g_free (url);
 
-		success = totem_pl_parser_write_string (handle, buf, error);
+		success = totem_pl_parser_write_string (G_OUTPUT_STREAM (stream), buf, error);
 		g_free (buf);
 
-		if (success == FALSE)
-		{
-			gnome_vfs_close (handle);
+		if (success == FALSE) {
+			g_output_stream_close (G_OUTPUT_STREAM (stream), NULL, NULL);
 			return FALSE;
 		}
 	}
 
-	gnome_vfs_close (handle);
+	g_output_stream_close (G_OUTPUT_STREAM (stream), NULL, NULL);
 
 	return TRUE;
 }
@@ -250,14 +243,15 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_ram (TotemPlParser *parser, const char *url, gpointer data)
+totem_pl_parser_add_ram (TotemPlParser *parser, GFile *file, gpointer data)
 {
 	gboolean retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents, **lines;
-	int size, i;
+	gsize size;
+	guint i;
 	const char *split_char;
 
-	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;
 
 	/* figure out whether we're a unix or dos RAM file */
@@ -279,14 +273,19 @@
 		/* Either it's a URI, or it has a proper path ... */
 		if (strstr(lines[i], "://") != NULL
 				|| lines[i][0] == G_DIR_SEPARATOR) {
+			GFile *line_file;
+
+			line_file = g_file_new_for_uri (lines[i]);
 			/* .ram files can contain .smil entries */
-			if (totem_pl_parser_parse_internal (parser, lines[i], NULL) != TOTEM_PL_PARSER_RESULT_SUCCESS) {
+			if (totem_pl_parser_parse_internal (parser, line_file, NULL) != TOTEM_PL_PARSER_RESULT_SUCCESS)
 				totem_pl_parser_parse_ram_url (parser, lines[i]);
-			}
+			g_object_unref (line_file);
 		} else if (strcmp (lines[i], "--stop--") == 0) {
 			/* For Real Media playlists, handle the stop command */
 			break;
 		} else {
+			//FIXME
+#if 0
 			char *base;
 
 			/* Try with a base */
@@ -300,6 +299,7 @@
 				g_free (fullpath);
 			}
 			g_free (base);
+#endif
 		}
 	}
 
@@ -343,6 +343,7 @@
 static char *
 totem_pl_parser_append_path (const char *base, const char *path)
 {
+#if 0
 	GnomeVFSURI *new, *baseuri;
 	char *fullpath;
 
@@ -360,12 +361,16 @@
 
 bail:
 	return g_strdup_printf ("%s/%s", base, path);
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_m3u (TotemPlParser *parser, const char *url,
-			const char *_base, gpointer data)
+totem_pl_parser_add_m3u (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *_base_file,
+			 gpointer data)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents, **lines;
 	int size, i;
@@ -464,21 +469,22 @@
 	g_strfreev (lines);
 
 	return retval;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_ra (TotemPlParser *parser, const char *url,
-			const char *base, gpointer data)
+totem_pl_parser_add_ra (TotemPlParser *parser,
+			GFile *file,
+			GFile *base_file, gpointer data)
 {
 	if (data == NULL || totem_pl_parser_is_uri_list (data, strlen (data)) == NULL) {
-		totem_pl_parser_add_one_url (parser, url, NULL);
+		totem_pl_parser_add_one_file (parser, file, NULL);
 		return TOTEM_PL_PARSER_RESULT_SUCCESS;
 	}
 
-	return totem_pl_parser_add_ram (parser, url, NULL);
+	return totem_pl_parser_add_ram (parser, file, NULL);
 }
 
-
 #endif /* !TOTEM_PL_PARSER_MINI */
 
 #define CHECK_LEN if (i >= len) { return NULL; }
Index: plparse/totem-pl-parser-lines.h
===================================================================
--- plparse/totem-pl-parser-lines.h	(revision 46)
+++ plparse/totem-pl-parser-lines.h	(working copy)
@@ -27,6 +27,7 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
@@ -42,15 +43,15 @@
 				    gpointer user_data,
 				    GError **error);
 TotemPlParserResult totem_pl_parser_add_ram (TotemPlParser *parser,
-					     const char *url,
+					     GFile *file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_m3u (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_ra (TotemPlParser *parser,
-					    const char *url,
-					    const char *base,
+					    GFile *file,
+					    GFile *base_file,
 					    gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-xspf.c
===================================================================
--- plparse/totem-pl-parser-xspf.c	(revision 41)
+++ plparse/totem-pl-parser-xspf.c	(working copy)
@@ -257,9 +257,12 @@
 }
 
 TotemPlParserResult
-totem_pl_parser_add_xspf (TotemPlParser *parser, const char *url,
-			  const char *_base, gpointer data)
+totem_pl_parser_add_xspf (TotemPlParser *parser,
+			  GFile *file,
+			  GFile *_base_file,
+			  gpointer data)
 {
+#if 0
 	xmlDocPtr doc;
 	xmlNodePtr node;
 	char *base;
@@ -286,6 +289,7 @@
 	g_free (base);
 	xmlFreeDoc(doc);
 	return retval;
+#endif
 }
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-wm.c
===================================================================
--- plparse/totem-pl-parser-wm.c	(revision 46)
+++ plparse/totem-pl-parser-wm.c	(working copy)
@@ -83,9 +83,11 @@
 
 static TotemPlParserResult
 totem_pl_parser_add_asf_reference_parser (TotemPlParser *parser,
-					  const char *url, const char *base,
+					  GFile *file,
+					  GFile *base_file,
 					  gpointer data)
 {
+#if 0
 	char *contents, **lines, *ref, *split_char;
 	int size;
 
@@ -119,15 +121,17 @@
 	 * supposed to be a fallback */
 
 	g_strfreev (lines);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 static TotemPlParserResult
 totem_pl_parser_add_asf_parser (TotemPlParser *parser,
-				const char *url, const char *base,
+				GFile *file,
+				GFile *base_file,
 				gpointer data)
 {
+#if 0
 	TotemPlParserResult retval = TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	char *contents, *ref;
 	int size;
@@ -157,7 +161,9 @@
 	}
 
 	g_free (contents);
+
 	return retval;
+#endif
 }
 
 static gboolean
@@ -260,7 +266,8 @@
 	fullpath = totem_pl_parser_resolve_url (base, url);
 
 	/* .asx files can contain references to other .asx files */
-	retval = totem_pl_parser_parse_internal (parser, fullpath, NULL);
+	//FIXME
+	//retval = totem_pl_parser_parse_internal (parser, fullpath, NULL);
 	if (retval != TOTEM_PL_PARSER_RESULT_SUCCESS) {
 		totem_pl_parser_add_url (parser,
 					 TOTEM_PL_PARSER_FIELD_URL, fullpath,
@@ -368,10 +375,11 @@
 
 TotemPlParserResult
 totem_pl_parser_add_asx (TotemPlParser *parser,
-			 const char *url,
-			 const char *base,
+			 GFile *file,
+			 GFile *base_file,
 			 gpointer data)
 {
+#if 0
 	xml_node_t* doc;
 	char *_base, *contents;
 	int size;
@@ -411,12 +419,16 @@
 	xml_parser_free_tree (doc);
 
 	return retval;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_add_asf (TotemPlParser *parser, const char *url,
-			 const char *base, gpointer data)
+totem_pl_parser_add_asf (TotemPlParser *parser,
+			 GFile *file,
+			 GFile *base_file,
+			 gpointer data)
 {
+#if 0
 	if (data == NULL) {
 		totem_pl_parser_add_one_url (parser, url, NULL);
 		return TOTEM_PL_PARSER_RESULT_SUCCESS;
@@ -426,8 +438,8 @@
 		totem_pl_parser_add_one_url (parser, url, NULL);
 		return TOTEM_PL_PARSER_RESULT_SUCCESS;
 	}
-
-	return totem_pl_parser_add_asf_parser (parser, url, base, data);
+#endif
+	return totem_pl_parser_add_asf_parser (parser, file, base_file, data);
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-qt.c
===================================================================
--- plparse/totem-pl-parser-qt.c	(revision 46)
+++ plparse/totem-pl-parser-qt.c	(working copy)
@@ -69,10 +69,11 @@
 
 static TotemPlParserResult
 totem_pl_parser_add_quicktime_rtsptext (TotemPlParser *parser,
-					const char *url,
-					const char *base,
+					GFile *file,
+					GFile *base_file,
 					gpointer data)
 {
+#if 0
 	char *contents = NULL;
 	gboolean dos_mode = FALSE;
 	char *volume, *autoplay, *rtspurl;
@@ -104,14 +105,16 @@
 	g_free (volume);
 	g_free (autoplay);
 	g_strfreev (lines);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 static TotemPlParserResult
-totem_pl_parser_add_quicktime_metalink (TotemPlParser *parser, const char *url,
-					const char *base, gpointer data)
+totem_pl_parser_add_quicktime_metalink (TotemPlParser *parser,
+					GFile *file,
+					GFile *base_file, gpointer data)
 {
+#if 0
 	xml_node_t *doc, *node;
 	int size;
 	char *contents;
@@ -189,20 +192,23 @@
 				 TOTEM_PL_PARSER_FIELD_AUTOPLAY, autoplay,
 				 NULL);
 	xml_parser_free_tree (doc);
-
+#endif
 	return TOTEM_PL_PARSER_RESULT_SUCCESS;
 }
 
 TotemPlParserResult
-totem_pl_parser_add_quicktime (TotemPlParser *parser, const char *url,
-			       const char *base, gpointer data)
+totem_pl_parser_add_quicktime (TotemPlParser *parser,
+			       GFile *file,
+			       GFile *base_file,
+			       gpointer data)
 {
+#if 0
 	if (data == NULL || totem_pl_parser_is_quicktime (data, strlen (data)) == NULL) {
 		totem_pl_parser_add_one_url (parser, url, NULL);
 		return TOTEM_PL_PARSER_RESULT_SUCCESS;
 	}
-
-	return totem_pl_parser_add_quicktime_metalink (parser, url, base, data);
+#endif
+	return totem_pl_parser_add_quicktime_metalink (parser, file, base_file, data);
 }
 
 #endif /* !TOTEM_PL_PARSER_MINI */
Index: plparse/totem-pl-parser-xspf.h
===================================================================
--- plparse/totem-pl-parser-xspf.h	(revision 41)
+++ plparse/totem-pl-parser-xspf.h	(working copy)
@@ -25,9 +25,10 @@
 
 G_BEGIN_DECLS
 
-#ifdef TOTEM_PL_PARSER_MINI
-#include "totem-pl-parser-mini.h"
-#endif /* TOTEM_PL_PARSER_MINI */
+#ifndef TOTEM_PL_PARSER_MINI
+#include "totem-pl-parser.h"
+#include <gio/gio.h>
+#endif /* !TOTEM_PL_PARSER_MINI */
 
 #ifndef TOTEM_PL_PARSER_MINI
 gboolean totem_pl_parser_write_xspf (TotemPlParser *parser,
@@ -38,8 +39,8 @@
 				     gpointer user_data,
 				     GError **error);
 TotemPlParserResult totem_pl_parser_add_xspf (TotemPlParser *parser,
-					      const char *url,
-					      const char *base,
+					      GFile *file,
+					      GFile *base_file,
 					      gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-wm.h
===================================================================
--- plparse/totem-pl-parser-wm.h	(revision 46)
+++ plparse/totem-pl-parser-wm.h	(working copy)
@@ -27,6 +27,7 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
@@ -36,12 +37,12 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_asf (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 TotemPlParserResult totem_pl_parser_add_asx (TotemPlParser *parser,
-					     const char *url,
-					     const char *base,
+					     GFile *file,
+					     GFile *base_file,
 					     gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser-qt.h
===================================================================
--- plparse/totem-pl-parser-qt.h	(revision 46)
+++ plparse/totem-pl-parser-qt.h	(working copy)
@@ -27,6 +27,7 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 #include "totem-pl-parser.h"
+#include <gio/gio.h>
 #else
 #include "totem-pl-parser-mini.h"
 #endif /* !TOTEM_PL_PARSER_MINI */
@@ -35,8 +36,8 @@
 
 #ifndef TOTEM_PL_PARSER_MINI
 TotemPlParserResult totem_pl_parser_add_quicktime (TotemPlParser *parser,
-						   const char *url,
-						   const char *base,
+						   GFile *file,
+						   GFile *base_file,
 						   gpointer data);
 #endif /* !TOTEM_PL_PARSER_MINI */
 
Index: plparse/totem-pl-parser.c
===================================================================
--- plparse/totem-pl-parser.c	(revision 46)
+++ plparse/totem-pl-parser.c	(working copy)
@@ -103,6 +103,8 @@
 #ifndef TOTEM_PL_PARSER_MINI
 #include <gobject/gvaluecollector.h>
 #include <gtk/gtk.h>
+#include <gio/gio.h>
+
 #include <libgnomevfs/gnome-vfs.h>
 #include <libgnomevfs/gnome-vfs-mime.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
@@ -134,7 +136,7 @@
 typedef const char * (*PlaylistIdenCallback) (const char *data, gsize len);
 
 #ifndef TOTEM_PL_PARSER_MINI
-typedef TotemPlParserResult (*PlaylistCallback) (TotemPlParser *parser, const char *url, const char *base, gpointer data);
+typedef TotemPlParserResult (*PlaylistCallback) (TotemPlParser *parser, GFile *url, GFile *base_file, gpointer data);
 #endif
 
 typedef struct {
@@ -484,6 +486,10 @@
 				     "String representing the location of an image for a playlist", NULL,
 				     G_PARAM_READABLE & G_PARAM_WRITABLE);
 	g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
+	pspec = g_param_spec_object ("gfile-object", "gfile-object",
+				     "Object representing the GFile for an entry", G_TYPE_FILE,
+				     G_PARAM_READABLE & G_PARAM_WRITABLE);
+	g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
 }
 
 static void
@@ -492,8 +498,7 @@
 	GList *list, *node;
 
 	list = g_param_spec_pool_list_owned (totem_pl_parser_pspec_pool, G_OBJECT_CLASS_TYPE (klass));
-	for (node = list; node; node = node->next)
-	{
+	for (node = list; node; node = node->next) {
 		GParamSpec *pspec = node->data;
 
 		g_param_spec_pool_remove (totem_pl_parser_pspec_pool, pspec);
@@ -610,89 +615,73 @@
 }
 
 static char *
-my_gnome_vfs_get_mime_type_with_data (const char *uri, gpointer *data, TotemPlParser *parser)
+my_g_file_info_get_mime_type_with_data (GFile *file, gpointer *data, TotemPlParser *parser)
 {
-	GnomeVFSResult result;
-	GnomeVFSHandle *handle;
 	char *buffer;
-	const char *mimetype;
-	GnomeVFSFileSize total_bytes_read;
-	GnomeVFSFileSize bytes_read;
+	char *mimetype;
+	gssize bytes_read;
+	GFileInputStream *stream;
+	GError *error = NULL;
 
 	*data = NULL;
 
 	/* Stat for a block device, we're screwed as far as speed
 	 * is concerned now */
-	if (g_str_has_prefix (uri, "file://") != FALSE) {
-		struct stat buf;
-		if (stat (uri + strlen ("file://"), &buf) == 0) {
-			if (S_ISBLK (buf.st_mode))
-				return g_strdup (BLOCK_DEVICE_TYPE);
+	if (g_file_has_uri_scheme (file, "file") != FALSE) {
+		GFileInfo *info;
+		info = g_file_query_info (file, G_FILE_ATTRIBUTE_UNIX_DEVICE,
+					  G_FILE_QUERY_INFO_NONE, NULL, NULL);
+		if (info != NULL && g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_UNIX_DEVICE)) {
+			g_object_unref (info);
+			return g_strdup (BLOCK_DEVICE_TYPE);
 		}
+		g_object_unref (info);
 	}
 
 	/* Open the file. */
-	result = gnome_vfs_open (&handle, uri, GNOME_VFS_OPEN_READ);
-	if (result != GNOME_VFS_OK) {
-		if (result == GNOME_VFS_ERROR_IS_DIRECTORY)
+	stream = g_file_read (file, NULL, &error);
+	if (stream == NULL) {
+		if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_IS_DIRECTORY) != FALSE) {
+			g_error_free (error);
 			return g_strdup (DIR_MIME_TYPE);
-		DEBUG(g_print ("URL '%s' couldn't be opened in _get_mime_type_with_data: '%s'\n", uri, gnome_vfs_result_to_string (result)));
+		}
+		DEBUG(file, g_print ("URL '%s' couldn't be opened in _get_mime_type_with_data: '%s'\n", uri, error->message));
+		g_error_free (error);
 		return NULL;
 	}
-	DEBUG(g_print ("URL '%s' was opened successfully in _get_mime_type_with_data:\n", uri));
+	DEBUG(file, g_print ("URL '%s' was opened successfully in _get_mime_type_with_data:\n", uri));
 
 	/* Read the whole thing, up to MIME_READ_CHUNK_SIZE */
-	buffer = NULL;
-	total_bytes_read = 0;
-	bytes_read = 0;
-	do {
-		buffer = g_realloc (buffer, total_bytes_read
-				+ MIME_READ_CHUNK_SIZE);
-		result = gnome_vfs_read (handle,
-				buffer + total_bytes_read,
-				MIME_READ_CHUNK_SIZE,
-				&bytes_read);
-		if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF) {
-			g_free (buffer);
-			gnome_vfs_close (handle);
-			return NULL;
-		}
-
-		/* Check for overflow. */
-		if (total_bytes_read + bytes_read < total_bytes_read) {
-			g_free (buffer);
-			gnome_vfs_close (handle);
-			return NULL;
-		}
-
-		total_bytes_read += bytes_read;
-	} while (result == GNOME_VFS_OK
-			&& total_bytes_read < MIME_READ_CHUNK_SIZE);
-
-	/* Close the file but don't overwrite the possible error */
-	if (result != GNOME_VFS_OK && result != GNOME_VFS_ERROR_EOF)
-		gnome_vfs_close (handle);
-	else
-		result = gnome_vfs_close (handle);
-
-	if (result != GNOME_VFS_OK) {
-		DEBUG(g_print ("URL '%s' couldn't be read or closed in _get_mime_type_with_data: '%s'\n", uri, gnome_vfs_result_to_string (result)));
+	buffer = g_malloc (MIME_READ_CHUNK_SIZE);
+	bytes_read = g_input_stream_read (G_INPUT_STREAM (stream), buffer, MIME_READ_CHUNK_SIZE, NULL, &error);
+	g_input_stream_close (G_INPUT_STREAM (stream), NULL, NULL);
+	if (bytes_read == -1) {
 		g_free (buffer);
 		return NULL;
 	}
 
 	/* Empty file */
-	if (total_bytes_read == 0) {
-		DEBUG(g_print ("URL '%s' is empty in _get_mime_type_with_data\n", uri));
+	if (bytes_read == 0) {
+		g_free (buffer);
+		DEBUG(file, g_print ("URL '%s' is empty in _get_mime_type_with_data\n", uri));
 		return g_strdup (EMPTY_FILE_TYPE);
 	}
 
 	/* Return the file null-terminated. */
-	buffer = g_realloc (buffer, total_bytes_read + 1);
-	buffer[total_bytes_read] = '\0';
+	buffer = g_realloc (buffer, bytes_read + 1);
+	buffer[bytes_read] = '\0';
 	*data = buffer;
 
-	mimetype = gnome_vfs_get_mime_type_for_data (*data, total_bytes_read);
+#ifdef G_OS_WIN32
+	{
+		char *content_type;
+		content_type = g_content_type_guess (NULL, *data, bytes_read, NULL);
+		mimetype = g_content_type_get_mime_type (content_type);
+		g_free (content_type);
+	}
+#else
+	mimetype = g_content_type_guess (NULL, *data, bytes_read, NULL);
+#endif
 
 	if (mimetype != NULL && strcmp (mimetype, "text/plain") == 0) {
 		PlaylistIdenCallback func;
@@ -706,13 +695,15 @@
 			if (func == dual_types[i].iden)
 				continue;
 			func = dual_types[i].iden;
-			res = func (*data, total_bytes_read);
-			if (res != NULL)
+			res = func (*data, bytes_read);
+			if (res != NULL) {
+				g_free (mimetype);
 				return g_strdup (res);
+			}
 		}
 	}
 
-	return g_strdup (mimetype);
+	return mimetype;
 }
 
 /**
@@ -724,28 +715,16 @@
  * Return value: a newly-allocated string containing @url's parent URI, or %NULL
  **/
 char *
-totem_pl_parser_base_url (const char *url)
+totem_pl_parser_base_url (GFile *file)
 {
-	/* Yay, let's reconstruct the base by hand */
-	GnomeVFSURI *uri, *parent;
-	char *base;
+	GFile *parent;
+	char *ret;
 
-	uri = gnome_vfs_uri_new (url);
-	if (uri == NULL)
-		return NULL;
+	parent = g_file_get_parent (file);
+	ret = g_file_get_uri (parent);
+	g_object_unref (file);
 
-	parent = gnome_vfs_uri_get_parent (uri);
-	if (!parent) {
-		parent = uri;
-	}
-	base = gnome_vfs_uri_to_string (parent, 0);
-
-	gnome_vfs_uri_unref (uri);
-	if (parent != uri) {
-		gnome_vfs_uri_unref (parent);
-	}
-
-	return base;
+	return ret;
 }
 
 /**
@@ -774,7 +753,7 @@
 
 /**
  * totem_pl_parser_write_string:
- * @handle: a #GnomeVFSHandle to an open file
+ * @handle: a #GFileOutputStream to an open file
  * @buf: the string buffer to write out
  * @error: return location for a #GError, or %NULL
  *
@@ -783,12 +762,12 @@
  * Return value: %TRUE on success
  **/
 gboolean
-totem_pl_parser_write_string (GnomeVFSHandle *handle, const char *buf, GError **error)
+totem_pl_parser_write_string (GOutputStream *stream, const char *buf, GError **error)
 {
 	guint len;
 
 	len = strlen (buf);
-	return totem_pl_parser_write_buffer (handle, buf, len, error);
+	return totem_pl_parser_write_buffer (stream, buf, len, error);
 }
 
 /**
@@ -803,19 +782,15 @@
  * Return value: %TRUE on success
  **/
 gboolean
-totem_pl_parser_write_buffer (GnomeVFSHandle *handle, const char *buf, guint len, GError **error)
+totem_pl_parser_write_buffer (GOutputStream *stream, const char *buf, guint len, GError **error)
 {
-	GnomeVFSResult res;
-	GnomeVFSFileSize written;
+	gsize bytes_written;
 
-	res = gnome_vfs_write (handle, buf, len, &written);
-	if (res != GNOME_VFS_OK || written < len) {
-		g_set_error (error,
-			     TOTEM_PL_PARSER_ERROR,
-			     TOTEM_PL_PARSER_ERROR_VFS_WRITE,
-			     _("Couldn't write parser: %s"),
-			     gnome_vfs_result_to_string (res));
-		gnome_vfs_close (handle);
+	if (g_output_stream_write_all (stream,
+				       buf, len,
+				       &bytes_written,
+				       NULL, error) == FALSE) {
+		g_output_stream_close (stream, NULL, NULL);
 		return FALSE;
 	}
 
@@ -847,15 +822,18 @@
 	{
 		GtkTreeIter iter;
 		char *url, *title;
+		GFile *file;
 		gboolean custom_title;
 
 		if (gtk_tree_model_iter_nth_child (model, &iter, NULL, i - 1) == FALSE)
 			return i - ignored;
 
 		func (model, &iter, &url, &title, &custom_title, user_data);
-		if (totem_pl_parser_scheme_is_ignored (parser, url) != FALSE)
+		file = g_file_new_for_uri (url);
+		if (totem_pl_parser_scheme_is_ignored (parser, file) != FALSE)
 			ignored++;
 
+		g_object_unref (file);
 		g_free (url);
 		g_free (title);
 	}
@@ -879,46 +857,24 @@
 char *
 totem_pl_parser_relative (const char *url, const char *output)
 {
-	char *url_base, *output_base;
-	char *base, *needle;
+	GFile *parent, *descendant, *out_file;
+	char *retval;
 
-	base = NULL;
-	url_base = totem_pl_parser_base_url (url);
-	if (url_base == NULL)
+	out_file = g_file_new_for_commandline_arg (output);
+	parent = g_file_get_parent (out_file);
+	if (parent == NULL) {
+		g_object_unref (out_file);
 		return NULL;
+	}
+	g_object_unref (out_file);
+	descendant = g_file_new_for_commandline_arg (url);
 
-	output_base = totem_pl_parser_base_url (output);
+	retval = g_file_get_relative_path (parent, descendant);
 
-	needle = strstr (url_base, output_base);
-	if (needle != NULL)
-	{
-		GnomeVFSURI *uri;
-		char *newurl;
+	g_object_unref (parent);
+	g_object_unref (descendant);
 
-		uri = gnome_vfs_uri_new (url);
-		newurl = gnome_vfs_uri_to_string (uri, 0);
-		if (newurl[strlen (output_base)] == '/') {
-			base = g_strdup (newurl + strlen (output_base) + 1);
-		} else {
-			/* Special case when the output and file are at the root */
-			if (strchr (newurl + strlen (output_base), '/') == NULL)
-				base = g_strdup (newurl + strlen (output_base));
-		}
-		gnome_vfs_uri_unref (uri);
-		g_free (newurl);
-
-		if (base != NULL) {
-			/* And finally unescape the string */
-			newurl = gnome_vfs_unescape_string (base, NULL);
-			g_free (base);
-			base = newurl;
-		}
-	}
-
-	g_free (url_base);
-	g_free (output_base);
-
-	return base;
+	return retval;
 }
 
 #ifndef TOTEM_PL_PARSER_MINI
@@ -1183,9 +1139,20 @@
 			break;
 		}
 
-		if (strcmp (name, TOTEM_PL_PARSER_FIELD_URL) == 0)
-			url = g_value_dup_string (&value);
-		else if (strcmp (name, TOTEM_PL_PARSER_FIELD_IS_PLAYLIST) == 0) {
+		if (strcmp (name, TOTEM_PL_PARSER_FIELD_URL) == 0) {
+			if (url == NULL)
+				url = g_value_dup_string (&value);
+		} else if (strcmp (name, TOTEM_PL_PARSER_FIELD_FILE) == 0) {
+			GFile *file;
+
+			file = g_value_get_object (&value);
+			url = g_file_get_uri (file);
+			g_object_unref (file);
+
+			g_value_unset (&value);
+			name = va_arg (var_args, char*);
+			continue;
+		} else if (strcmp (name, TOTEM_PL_PARSER_FIELD_IS_PLAYLIST) == 0) {
 			is_playlist = g_value_get_boolean (&value);
 			g_value_unset (&value);
 			name = va_arg (var_args, char*);
@@ -1276,9 +1243,19 @@
 				 NULL);
 }
 
+void
+totem_pl_parser_add_one_file (TotemPlParser *parser, GFile *file, const char *title)
+{
+	totem_pl_parser_add_url (parser,
+				 TOTEM_PL_PARSER_FIELD_FILE, file,
+				 TOTEM_PL_PARSER_FIELD_TITLE, title,
+				 NULL);
+}
+
 static char *
 totem_pl_parser_remove_filename (const char *url)
 {
+#if 0
 	char *no_frag, *no_file, *no_qmark, *qmark;
 
 	no_frag = gnome_vfs_make_uri_canonical_strip_fragment (url);
@@ -1291,6 +1268,7 @@
 	g_free (no_frag);
 
 	return no_file;
+#endif
 }
 
 static gboolean
@@ -1331,8 +1309,15 @@
 		return g_strdup (url);
 
 	/* Strip fragment and filename */
-	base_no_frag = totem_pl_parser_remove_filename (base);
+//	base_no_frag = totem_pl_parser_remove_filename (base);
 
+	GFile *file, *rel;
+
+	file = g_file_new_for_uri (base);
+	rel = g_file_resolve_relative_path (file, url);
+
+	return g_file_get_uri (rel);
+#if 0
 	/* gnome_vfs_uri_append_path is trying to be clever and
 	 * merges paths that look like they're the same */
 	if (totem_pl_parser_might_be_file (base) != FALSE) {
@@ -1363,6 +1348,7 @@
 	gnome_vfs_uri_unref (new);
 
 	return resolved;
+#endif
 }
 
 static PlaylistTypes ignore_types[] = {
@@ -1384,24 +1370,22 @@
  * Return value: %TRUE if @url's scheme is ignored
  **/
 gboolean
-totem_pl_parser_scheme_is_ignored (TotemPlParser *parser, const char *url)
+totem_pl_parser_scheme_is_ignored (TotemPlParser *parser, GFile *file)
 {
 	GList *l;
 
 	if (parser->priv->ignore_schemes == NULL)
 		return FALSE;
 
-	for (l = parser->priv->ignore_schemes; l != NULL; l = l->next)
-	{
+	for (l = parser->priv->ignore_schemes; l != NULL; l = l->next) {
 		const char *scheme = l->data;
-		if (g_str_has_prefix (url, scheme) != FALSE)
+		if (g_file_has_uri_scheme (file, scheme) != FALSE)
 			return TRUE;
 	}
 
 	return FALSE;
 }
 
-//FIXME remove ?
 static gboolean
 totem_pl_parser_mimetype_is_ignored (TotemPlParser *parser,
 				     const char *mimetype)
@@ -1442,33 +1426,58 @@
 gboolean
 totem_pl_parser_ignore (TotemPlParser *parser, const char *url)
 {
-	const char *mimetype;
+	char *mimetype;
+	GFile *file;
 	guint i;
 
-	if (totem_pl_parser_scheme_is_ignored (parser, url) != FALSE)
+	file = g_file_new_for_path (url);
+	if (totem_pl_parser_scheme_is_ignored (parser, file) != FALSE) {
+		g_object_unref (file);
 		return TRUE;
+	}
+	g_object_unref (file);
 
-	mimetype = gnome_vfs_get_file_mime_type (url, NULL, TRUE);
-	if (mimetype == NULL || strcmp (mimetype, GNOME_VFS_MIME_TYPE_UNKNOWN) == 0)
+	mimetype = g_content_type_guess (url, NULL, 0, NULL);
+	if (mimetype == NULL || strcmp (mimetype, GNOME_VFS_MIME_TYPE_UNKNOWN) == 0) {
+		g_free (mimetype);
 		return FALSE;
+	}
 
-	for (i = 0; i < G_N_ELEMENTS (special_types); i++)
-		if (strcmp (special_types[i].mimetype, mimetype) == 0)
+	for (i = 0; i < G_N_ELEMENTS (special_types); i++) {
+		if (strcmp (special_types[i].mimetype, mimetype) == 0) {
+			g_free (mimetype);
 			return FALSE;
+		}
+	}
 
-	for (i = 0; i < G_N_ELEMENTS (dual_types); i++)
-		if (strcmp (dual_types[i].mimetype, mimetype) == 0)
+	for (i = 0; i < G_N_ELEMENTS (dual_types); i++) {
+		if (strcmp (dual_types[i].mimetype, mimetype) == 0) {
+			g_free (mimetype);
 			return FALSE;
+		}
+	}
 
+	g_free (mimetype);
+
 	return TRUE;
 }
 
+//FIXME this probably doesn't work on Windows
 static gboolean
 totem_pl_parser_ignore_from_mimetype (TotemPlParser *parser, const char *mimetype)
 {
-	char *super;
+//	char *super;
 	guint i;
 
+	for (i = 0; i < G_N_ELEMENTS (ignore_types); i++) {
+		if (g_content_type_is_a (mimetype, ignore_types[i].mimetype) != FALSE)
+			return TRUE;
+		if (g_content_type_equals (mimetype, ignore_types[i].mimetype) != FALSE)
+			return TRUE;
+	}
+
+	return FALSE;
+#if 0
 	super = gnome_vfs_get_supertype_from_mime_type (mimetype);
 	for (i = 0; i < G_N_ELEMENTS (ignore_types) && super != NULL; i++) {
 		if (gnome_vfs_mime_type_is_supertype (ignore_types[i].mimetype) != FALSE) {
@@ -1489,11 +1498,13 @@
 	g_free (super);
 
 	return FALSE;
+#endif
 }
 
 TotemPlParserResult
-totem_pl_parser_parse_internal (TotemPlParser *parser, const char *url,
-				const char *base)
+totem_pl_parser_parse_internal (TotemPlParser *parser,
+				GFile *file,
+				GFile *base_file)
 {
 	char *mimetype;
 	guint i;
@@ -1504,41 +1515,53 @@
 	if (parser->priv->recurse_level > RECURSE_LEVEL_MAX)
 		return TOTEM_PL_PARSER_RESULT_ERROR;
 
-	/* Shouldn't gnome-vfs have a list of schemes it supports? */
-	if (g_str_has_prefix (url, "mms") != FALSE
-			|| g_str_has_prefix (url, "rtsp") != FALSE
-			|| g_str_has_prefix (url, "icy") != FALSE) {
-		DEBUG(g_print ("URL '%s' is MMS, RTSP or ICY, ignoring\n", url));
+	if (g_file_has_uri_scheme (file, "mms") != FALSE
+			|| g_file_has_uri_scheme (file, "rtsp") != FALSE
+			|| g_file_has_uri_scheme (file, "icy") != FALSE) {
+		DEBUG(file, g_print ("URL '%s' is MMS, RTSP or ICY, ignoring\n", uri));
 		return TOTEM_PL_PARSER_RESULT_UNHANDLED;
 	}
 
 	/* Fix up itpc, see http://www.apple.com/itunes/store/podcaststechspecs.html */
-	if (g_str_has_prefix (url, "itpc") != FALSE) {
-		DEBUG(g_print ("URL '%s' is getting special cased for ITPC parsing\n", url));
-		return totem_pl_parser_add_itpc (parser, url, base, NULL);
+	if (g_file_has_uri_scheme (file, "itpc") != FALSE) {
+		DEBUG(file, g_print ("URL '%s' is getting special cased for ITPC parsing\n", uri));
+		return totem_pl_parser_add_itpc (parser, file, base_file, NULL);
 	}
 	/* Try itms Podcast references, see itunes.py in PenguinTV */
-	if (totem_pl_parser_is_itms_feed (url) != FALSE) {
-	    	DEBUG(g_print ("URL '%s' is getting special cased for ITMS parsing\n", url));
-	    	return totem_pl_parser_add_itms (parser, url, NULL, NULL);
+	if (totem_pl_parser_is_itms_feed (file) != FALSE) {
+	    	DEBUG(file, g_print ("URL '%s' is getting special cased for ITMS parsing\n", uri));
+	    	return totem_pl_parser_add_itms (parser, file, NULL, NULL);
 	}
 
-	if (!parser->priv->recurse && parser->priv->recurse_level > 0) {
+	if (!parser->priv->recurse && parser->priv->recurse_level > 0)
 		return TOTEM_PL_PARSER_RESULT_UNHANDLED;
-	}
 
 	/* In force mode we want to get the data */
 	if (parser->priv->force != FALSE) {
-		mimetype = my_gnome_vfs_get_mime_type_with_data (url, &data, parser);
+		mimetype = my_g_file_info_get_mime_type_with_data (file, &data, parser);
 	} else {
-		mimetype = g_strdup (gnome_vfs_get_mime_type_for_name (url));
+		char *uri;
+
+		uri = g_file_get_uri (file);
+#ifdef G_OS_WIN32
+		{
+			char *content_type;
+			content_type = g_content_type_guess (uri, NULL, 0, NULL);
+			mimetype = g_content_type_get_mime_type (content_type);
+			g_free (content_type);
+		}
+#else
+		mimetype = g_content_type_guess (uri, NULL, 0, NULL);
+#endif
+
+		g_free (uri);
 	}
 
-	DEBUG(g_print ("_get_mime_type_for_name for '%s' returned '%s'\n", url, mimetype));
+	DEBUG(file, g_print ("_get_mime_type_for_name for '%s' returned '%s'\n", uri, mimetype));
 	if (mimetype == NULL || strcmp (GNOME_VFS_MIME_TYPE_UNKNOWN, mimetype) == 0) {
 		g_free (mimetype);
-		mimetype = my_gnome_vfs_get_mime_type_with_data (url, &data, parser);
-		DEBUG(g_print ("_get_mime_type_with_data for '%s' returned '%s'\n", url, mimetype ? mimetype : "NULL"));
+		mimetype = my_g_file_info_get_mime_type_with_data (file, &data, parser);
+		DEBUG(file, g_print ("_get_mime_type_with_data for '%s' returned '%s'\n", uri, mimetype ? mimetype : "NULL"));
 	}
 
 	if (mimetype == NULL) {
@@ -1556,12 +1579,12 @@
 	 * data from the playlist parser */
 	if (strcmp (mimetype, AUDIO_MPEG_TYPE) == 0 && parser->priv->recurse_level == 0 && data == NULL) {
 		char *tmp;
-		tmp = my_gnome_vfs_get_mime_type_with_data (url, &data, parser);
+		tmp = my_g_file_info_get_mime_type_with_data (file, &data, parser);
 		if (tmp != NULL) {
 			g_free (mimetype);
 			mimetype = tmp;
 		}
-		DEBUG(g_print ("_get_mime_type_with_data for '%s' returned '%s' (was %s)\n", url, mimetype, AUDIO_MPEG_TYPE));
+		DEBUG(file, g_print ("_get_mime_type_with_data for '%s' returned '%s' (was %s)\n", uri, mimetype, AUDIO_MPEG_TYPE));
 	}
 
 	if (totem_pl_parser_mimetype_is_ignored (parser, mimetype) != FALSE) {
@@ -1575,13 +1598,13 @@
 
 		for (i = 0; i < G_N_ELEMENTS(special_types); i++) {
 			if (strcmp (special_types[i].mimetype, mimetype) == 0) {
-				DEBUG(g_print ("URL '%s' is special type '%s'\n", url, mimetype));
+				DEBUG(file, g_print ("URL '%s' is special type '%s'\n", uri, mimetype));
 				if (parser->priv->disable_unsafe != FALSE && special_types[i].unsafe != FALSE) {
 					g_free (mimetype);
 					g_free (data);
 					return TOTEM_PL_PARSER_RESULT_IGNORED;
 				}
-				ret = (* special_types[i].func) (parser, url, base, data);
+				ret = (* special_types[i].func) (parser, file, base_file, data);
 				found = TRUE;
 				break;
 			}
@@ -1589,12 +1612,12 @@
 
 		for (i = 0; i < G_N_ELEMENTS(dual_types) && found == FALSE; i++) {
 			if (strcmp (dual_types[i].mimetype, mimetype) == 0) {
-				DEBUG(g_print ("URL '%s' is dual type '%s'\n", url, mimetype));
+				DEBUG(file, g_print ("URL '%s' is dual type '%s'\n", uri, mimetype));
 				if (data == NULL) {
 					g_free (mimetype);
-					mimetype = my_gnome_vfs_get_mime_type_with_data (url, &data, parser);
+					mimetype = my_g_file_info_get_mime_type_with_data (file, &data, parser);
 				}
-				ret = (* dual_types[i].func) (parser, url, base, data);
+				ret = (* dual_types[i].func) (parser, file, base_file, data);
 				found = TRUE;
 				break;
 			}
@@ -1617,7 +1640,7 @@
 	g_free (mimetype);
 
 	if (ret != TOTEM_PL_PARSER_RESULT_SUCCESS && parser->priv->fallback) {
-		totem_pl_parser_add_one_url (parser, url, NULL);
+		totem_pl_parser_add_one_file (parser, file, NULL);
 		return TOTEM_PL_PARSER_RESULT_SUCCESS;
 	}
 
@@ -1641,18 +1664,33 @@
 totem_pl_parser_parse_with_base (TotemPlParser *parser, const char *url,
 				 const char *base, gboolean fallback)
 {
+	GFile *file, *base_file;
+	TotemPlParserResult retval;
+
 	g_return_val_if_fail (TOTEM_IS_PL_PARSER (parser), TOTEM_PL_PARSER_RESULT_UNHANDLED);
 	g_return_val_if_fail (url != NULL, TOTEM_PL_PARSER_RESULT_UNHANDLED);
+	g_return_val_if_fail (strstr (url, "://") != NULL,
+			TOTEM_PL_PARSER_RESULT_ERROR);
 
-	if (totem_pl_parser_scheme_is_ignored (parser, url) != FALSE)
+	file = g_file_new_for_uri (url);
+	base_file = NULL;
+
+	if (totem_pl_parser_scheme_is_ignored (parser, file) != FALSE) {
+		g_object_unref (file);
 		return TOTEM_PL_PARSER_RESULT_UNHANDLED;
+	}
 
-	g_return_val_if_fail (strstr (url, "://") != NULL,
-			TOTEM_PL_PARSER_RESULT_ERROR);
-
 	parser->priv->recurse_level = 0;
 	parser->priv->fallback = fallback != FALSE;
-	return totem_pl_parser_parse_internal (parser, url, base);
+	if (base != NULL)
+		base_file = g_file_new_for_uri (base);
+	retval = totem_pl_parser_parse_internal (parser, file, base_file);
+
+	g_object_unref (file);
+	if (base_file != NULL)
+		g_object_unref (base_file);
+
+	return retval;
 }
 
 /**
@@ -1769,21 +1807,6 @@
 	return -1;
 }
 
-/* FIXME remove when http://bugzilla.gnome.org/show_bug.cgi?id=503029
- * is fixed */
-static gboolean
-totem_pl_parser_is_iso8601_date (const char *date_str)
-{
-	while (g_ascii_isspace (*date_str))
-		date_str++;
-	if (*date_str == '\0')
-		return FALSE;
-	if (!g_ascii_isdigit (*date_str) && *date_str != '-' && *date_str != '+')
-		return FALSE;
-
-	return TRUE;
-}
-
 /**
  * totem_pl_parser_parse_date:
  * @date_str: the date string to parse
@@ -1803,8 +1826,7 @@
 
 	memset (&val, 0, sizeof(val));
 	/* Try to parse as an ISO8601/RFC3339 date */
-	if (totem_pl_parser_is_iso8601_date (date_str) != FALSE
-	    && g_time_val_from_iso8601 (date_str, &val) != FALSE) {
+	if (g_time_val_from_iso8601 (date_str, &val) != FALSE) {
 		D(g_message ("Parsed duration '%s' using the ISO8601 parser", date_str));
 		return val.tv_sec;
 	}
