diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c
index 004cb8e..ff623d6 100644
--- a/backend/comics/comics-document.c
+++ b/backend/comics/comics-document.c
@@ -23,7 +23,6 @@
 #include <unistd.h>
 #include <string.h>
 #include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs-mime-utils.h>
 
 #include "comics-document.h"
 #include "ev-document-misc.h"
@@ -109,7 +108,10 @@ comics_document_load (EvDocument *document,
 {
 	ComicsDocument *comics_document = COMICS_DOCUMENT (document);
 	GSList *supported_extensions;
-	gchar *list_files_command = NULL, *std_out, *quoted_file, *mime_type;
+	GFile *file;
+	GFileInfo *file_info;
+	gchar *list_files_command = NULL, *std_out, *quoted_file;
+	const char *mime_type = NULL;
 	gchar **cbr_files;
 	gboolean success;
 	int i, retval;
@@ -118,7 +120,15 @@ comics_document_load (EvDocument *document,
 	g_return_val_if_fail (comics_document->archive != NULL, FALSE);
 
 	quoted_file = g_shell_quote (comics_document->archive);
-	mime_type = gnome_vfs_get_mime_type (uri);
+	file = g_file_new_for_uri (uri);
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+				       0, NULL, NULL);
+	if (file_info != NULL) {
+		mime_type = g_file_info_get_content_type (file_info);
+		g_object_unref (file_info);
+	}
+	g_object_unref (file);
 
 	/* FIXME, use proper cbr/cbz mime types once they're
 	 * included in shared-mime-info */
diff --git a/configure.ac b/configure.ac
index 381f29d..45a8eae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -47,6 +47,7 @@ dnl Check dependencies
 
 DBUS_GLIB_REQUIRED=0.70
 GTK_REQUIRED=2.10.0
+GLIB_REQUIRED=2.15.3
 KEYRING_REQUIRED=0.4.0
 
 LIBGNOMEUI_REQUIRED=2.14.0
@@ -57,10 +58,10 @@ LIBXML_REQUIRED=2.5.0
 
 GTK_PRINT_REQUIRED=2.10.0
 
-PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED gnome-vfs-2.0)
+PKG_CHECK_MODULES(LIB, gtk+-2.0 >= $GTK_REQUIRED libxml-2.0 >= $LIBXML_REQUIRED glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED)
 PKG_CHECK_MODULES(BACKEND, gtk+-2.0 >= $GTK_REQUIRED)
-PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 gnome-vfs-2.0)
-PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED gnome-vfs-2.0 libglade-2.0 gconf-2.0 gnome-keyring-1 >= $KEYRING_REQUIRED)
+PKG_CHECK_MODULES(FRONTEND_CORE, gtk+-2.0 >= $GTK_REQUIRED libglade-2.0 glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED)
+PKG_CHECK_MODULES(SHELL_CORE, libxml-2.0 >= $LIBXML_REQUIRED gtk+-2.0 >= $GTK_REQUIRED gnome-icon-theme >= $GNOME_ICON_THEME_REQUIRED libglade-2.0 gconf-2.0 gnome-keyring-1 >= $KEYRING_REQUIRED glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED)
 
 BACKEND_LIBTOOL_FLAGS="-module -avoid-version"
 AC_SUBST(BACKEND_LIBTOOL_FLAGS)
diff --git a/libdocument/ev-attachment.c b/libdocument/ev-attachment.c
index 7592c4f..3a1366b 100644
--- a/libdocument/ev-attachment.c
+++ b/libdocument/ev-attachment.c
@@ -18,11 +18,9 @@
  */
 
 #include <config.h>
+#include <gio/gio.h>
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <libgnomevfs/gnome-vfs-mime-handlers.h>
-#include <libgnomevfs/gnome-vfs-mime-utils.h>
 #include "ev-file-helpers.h"
 #include "ev-attachment.h"
 
@@ -46,8 +44,8 @@ struct _EvAttachmentPrivate {
 	gchar                   *data;
 	gchar                   *mime_type;
 
-	GnomeVFSMimeApplication *app;
-	gchar                   *tmp_uri;
+	GAppInfo                *app;
+	GFile                   *tmp_file;
 };
 
 #define EV_ATTACHMENT_GET_PRIVATE(object) \
@@ -93,14 +91,14 @@ ev_attachment_finalize (GObject *object)
 	}
 
 	if (attachment->priv->app) {
-		gnome_vfs_mime_application_free (attachment->priv->app);
+		g_object_unref (attachment->priv->app);
 		attachment->priv->app = NULL;
 	}
 
-	if (attachment->priv->tmp_uri) {
-		ev_tmp_filename_unlink (attachment->priv->tmp_uri);
-		g_free (attachment->priv->tmp_uri);
-		attachment->priv->tmp_uri = NULL;
+	if (attachment->priv->tmp_file) {
+		ev_tmp_file_unlink (attachment->priv->tmp_file);
+		g_free (attachment->priv->tmp_file);
+		attachment->priv->tmp_file = NULL;
 	}
 
 	(* G_OBJECT_CLASS (ev_attachment_parent_class)->finalize) (object);
@@ -132,9 +130,10 @@ ev_attachment_set_property (GObject      *object,
 		break;
 	case PROP_DATA:
 		attachment->priv->data = g_value_get_pointer (value);
-		attachment->priv->mime_type =
-			g_strdup (gnome_vfs_get_mime_type_for_data (attachment->priv->data,
-								    attachment->priv->size));
+		attachment->priv->mime_type = g_content_type_guess (attachment->priv->name,
+								    (guchar *) attachment->priv->data,
+								    attachment->priv->size,
+								    NULL);
 		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object,
@@ -217,7 +216,7 @@ ev_attachment_init (EvAttachment *attachment)
 	attachment->priv->data = NULL;
 	attachment->priv->mime_type = NULL;
 
-	attachment->priv->tmp_uri = NULL;
+	attachment->priv->tmp_file = NULL;
 }
 
 EvAttachment *
@@ -284,78 +283,94 @@ ev_attachment_get_mime_type (EvAttachment *attachment)
 
 gboolean
 ev_attachment_save (EvAttachment *attachment,
-		    const gchar  *uri,
+		    GFile        *file,
 		    GError      **error)
 {
-	GnomeVFSHandle  *handle = NULL;
-	GnomeVFSFileSize written;
-	GnomeVFSResult   result;
-	
+	GFileOutputStream *output_stream;
+	GError *ioerror;
+	gssize  written_bytes;
+
 	g_return_val_if_fail (EV_IS_ATTACHMENT (attachment), FALSE);
-	g_return_val_if_fail (uri != NULL, FALSE);
+	g_return_val_if_fail (file != NULL, FALSE);
 
-	result = gnome_vfs_create (&handle, uri,
-				   GNOME_VFS_OPEN_WRITE,
-				   FALSE, 0644);
-	if (result != GNOME_VFS_OK) {
+	output_stream = g_file_create (file,
+				       0, NULL, &ioerror);
+	if (output_stream == NULL) {
+		char *uri;
+		
+		uri = g_file_get_uri (file);
 		g_set_error (error,
 			     EV_ATTACHMENT_ERROR, 
-			     (gint) result,
+			     ioerror->code,
 			     _("Couldn't save attachment “%s”: %s"),
 			     uri, 
-			     gnome_vfs_result_to_string (result));
+			     ioerror->message);
+
+		g_error_free (ioerror);
+		g_free (uri);
 		
 		return FALSE;
 	}
 
-	result = gnome_vfs_write (handle, attachment->priv->data,
-				  attachment->priv->size, &written);
-	if (result != GNOME_VFS_OK || written < attachment->priv->size){
+	
+	written_bytes = g_output_stream_write (G_OUTPUT_STREAM (output_stream),
+					       attachment->priv->data,
+					       attachment->priv->size,
+					       NULL, &ioerror);
+	if (written_bytes == -1) {
+		char *uri;
+		
+		uri = g_file_get_uri (file);
 		g_set_error (error,
 			     EV_ATTACHMENT_ERROR,
-			     (gint) result,
+			     ioerror->code,
 			     _("Couldn't save attachment “%s”: %s"),
 			     uri,
-			     gnome_vfs_result_to_string (result));
+			     ioerror->message);
 		
-		gnome_vfs_close (handle);
+		g_output_stream_close (G_OUTPUT_STREAM (output_stream), NULL, NULL);
+		g_error_free (ioerror);
+		g_free (uri);
 
 		return FALSE;
 	}
 
-	gnome_vfs_close (handle);
+	g_output_stream_close (G_OUTPUT_STREAM (output_stream), NULL, NULL);
 
 	return TRUE;
+	
 }
 
 static gboolean
 ev_attachment_launch_app (EvAttachment *attachment,
 			  GError      **error)
 {
-	GnomeVFSResult result;
-	GList         *uris = NULL;
+	gboolean       result;
+	GList         *files = NULL;
+	GError        *ioerror;
 
-	g_assert (attachment->priv->tmp_uri != NULL);
+	g_assert (attachment->priv->tmp_file != NULL);
 	g_assert (attachment->priv->app != NULL);
 
-	uris = g_list_prepend (uris, attachment->priv->tmp_uri);
-	result = gnome_vfs_mime_application_launch (attachment->priv->app,
-						    uris);
+	files = g_list_prepend (files, attachment->priv->tmp_file);
+	result = g_app_info_launch (attachment->priv->app, files,
+				    NULL, &ioerror);
 
-	if (result != GNOME_VFS_OK) {
+	if (!result) {
 		g_set_error (error,
 			     EV_ATTACHMENT_ERROR,
 			     (gint) result,
 			     _("Couldn't open attachment “%s”: %s"),
 			     attachment->priv->name,
-			     gnome_vfs_result_to_string (result));
+			     ioerror->message);
 
-		g_list_free (uris);
+		g_list_free (files);
+		g_error_free (ioerror);
 		
 		return FALSE;
 	}
 
-	g_list_free (uris);
+	g_list_free (files);
 	
 	return TRUE;
 }
@@ -364,15 +379,14 @@ gboolean
 ev_attachment_open (EvAttachment *attachment,
 		    GError      **error)
 {
-
-	gboolean                 retval = FALSE;
-	GnomeVFSMimeApplication *default_app = NULL;
+	GAppInfo *app_info;
+	gboolean  retval = FALSE;
 
 	g_return_val_if_fail (EV_IS_ATTACHMENT (attachment), FALSE);
 	
 	if (!attachment->priv->app) {
-		default_app = gnome_vfs_mime_get_default_application (attachment->priv->mime_type);
-		attachment->priv->app = default_app;
+		app_info = g_app_info_get_default_for_type (attachment->priv->mime_type, TRUE);
+		attachment->priv->app = app_info;
 	}
 
 	if (!attachment->priv->app) {
@@ -385,26 +399,28 @@ ev_attachment_open (EvAttachment *attachment,
 		return FALSE;
 	}
 
-	if (attachment->priv->tmp_uri &&
-	    g_file_test (attachment->priv->tmp_uri, G_FILE_TEST_EXISTS)) {
+	if (attachment->priv->tmp_file &&
+	    g_file_query_exists (attachment->priv->tmp_file, NULL)) {
 		retval = ev_attachment_launch_app (attachment, error);
 	} else {
-		gchar *uri, *filename;
+		GFile *tmpdir;
+		GFile *file;
 		
-		filename = g_build_filename (ev_tmp_dir (), attachment->priv->name, NULL);
-		uri = g_filename_to_uri (filename, NULL, NULL);
+		tmpdir = g_file_new_for_path (ev_tmp_dir ());
+		file = g_file_get_child (tmpdir, attachment->priv->name);
 
-		if (ev_attachment_save (attachment, uri, error)) {
-			if (attachment->priv->tmp_uri)
-				g_free (attachment->priv->tmp_uri);
-			attachment->priv->tmp_uri = g_strdup (filename);
+		if (ev_attachment_save (attachment, file, error)) {
+			if (attachment->priv->tmp_file)
+				g_free (attachment->priv->tmp_file);
+			attachment->priv->tmp_file = g_object_ref (file);
 
 			retval = ev_attachment_launch_app (attachment, error);
 		}
 
-		g_free (filename);
-		g_free (uri);
+		g_object_unref (file);
+		g_object_unref (tmpdir);
 	}
 
 	return retval;
 }
+
diff --git a/libdocument/ev-attachment.h b/libdocument/ev-attachment.h
index 994b654..8403bee 100644
--- a/libdocument/ev-attachment.h
+++ b/libdocument/ev-attachment.h
@@ -21,6 +21,7 @@
 #define __EV_ATTACHMENT_H__
 
 #include <glib-object.h>
+#include <gio/gio.h>
 
 G_BEGIN_DECLS
 
@@ -62,7 +63,7 @@ GTime        ev_attachment_get_modification_date (EvAttachment *attachment);
 GTime        ev_attachment_get_creation_date     (EvAttachment *attachment);
 const gchar *ev_attachment_get_mime_type         (EvAttachment *attachment);
 gboolean     ev_attachment_save                  (EvAttachment *attachment,
-						  const gchar  *uri,
+						  GFile        *file,
 						  GError      **error);
 gboolean     ev_attachment_open                  (EvAttachment *attachment,
 						  GError      **error);
diff --git a/libdocument/ev-document-factory.c b/libdocument/ev-document-factory.c
index 21e0b4a..31547e5 100644
--- a/libdocument/ev-document-factory.c
+++ b/libdocument/ev-document-factory.c
@@ -23,11 +23,9 @@
 #endif
 
 #include <string.h>
+#include <gio/gio.h>
 #include <glib/gstdio.h>
 #include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs-mime-utils.h>
-#include <libgnomevfs/gnome-vfs-file-info.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
 #include <gtk/gtkfilechooserdialog.h>
 
 #include "ev-backends-manager.h"
@@ -112,55 +110,58 @@ get_document_from_uri (const char        *uri,
 		       GError           **error)
 {
 	EvDocument *document = NULL;
-        GnomeVFSFileInfo *info;
-        GnomeVFSResult result;
+	GFile *file;
+	GFileInfo *file_info;
+	const char *content_type;
 
 	*compression = EV_COMPRESSION_NONE;
 
-        info = gnome_vfs_file_info_new ();
-        result = gnome_vfs_get_file_info (uri, info,
-	    			          GNOME_VFS_FILE_INFO_GET_MIME_TYPE |
-		                          GNOME_VFS_FILE_INFO_FOLLOW_LINKS | 
-					  (slow ? GNOME_VFS_FILE_INFO_FORCE_SLOW_MIME_TYPE : 0));
-        if (result != GNOME_VFS_OK) {
+	file = g_file_new_for_uri (uri);
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+				       0, NULL, NULL);
+	g_object_unref (file);
+
+	if (file_info == NULL)
+	{
 		g_set_error (error,
 			     EV_DOCUMENT_ERROR,
 			     0,
-			     gnome_vfs_result_to_string (result));			
-		gnome_vfs_file_info_unref (info);
+			     _("Failed to get info for document"));			
 		return NULL;
-        } 
-	
-	if (info->mime_type == NULL) {
+	}
+	content_type = g_file_info_get_content_type (file_info);
+
+	if (content_type == NULL) {
 		g_set_error (error,
 			     EV_DOCUMENT_ERROR,	
     			     0,
 			     _("Unknown MIME Type"));
-		gnome_vfs_file_info_unref (info);
+		g_object_unref (file_info);
 		return NULL;
 	}
 
 #ifdef ENABLE_PIXBUF
-	if (mime_type_supported_by_gdk_pixbuf (info->mime_type)) {
+	if (mime_type_supported_by_gdk_pixbuf (content_type)) {
 		document = ev_backends_manager_get_document ("image/*");
 	} else
-		document = ev_backends_manager_get_document (info->mime_type);
+		document = ev_backends_manager_get_document (content_type);
 #else
-	document = ev_backends_manager_get_document (info->mime_type);
+	document = ev_backends_manager_get_document (content_type);
 #endif /* ENABLE_PIXBUF */
 
 	if (document == NULL) {
 		g_set_error (error,
 			     EV_DOCUMENT_ERROR,	
 			     0,
-			     _("Unhandled MIME type: “%s”"), info->mime_type);
-		gnome_vfs_file_info_unref (info);
+			     _("Unhandled MIME type: “%s”"), content_type);
+		g_object_unref (file_info);
 		return NULL;
 	}
 
-	*compression = get_compression_from_mime_type (info->mime_type);
+	*compression = get_compression_from_mime_type (content_type);
 
-        gnome_vfs_file_info_unref (info);
+        g_object_unref (file_info);
 	
         return document;
 }
diff --git a/libdocument/ev-file-helpers.c b/libdocument/ev-file-helpers.c
index dd3b3e1..9b6b3a8 100644
--- a/libdocument/ev-file-helpers.c
+++ b/libdocument/ev-file-helpers.c
@@ -29,10 +29,6 @@
 #include <glib.h>
 #include <glib/gstdio.h>
 #include <errno.h>
-#include <libgnomevfs/gnome-vfs-uri.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-xfer.h>
 
 #if WITH_GNOME
 #include <libgnome/gnome-init.h>
@@ -122,6 +118,20 @@ ev_file_helpers_shutdown (void)
 	tmp_dir = NULL;
 }
 
+GFile *
+ev_tmp_file_get (const gchar *prefix)
+{
+	gchar *path;
+	GFile *file;
+
+	path = ev_tmp_filename (prefix);
+	file = g_file_new_for_path (path);
+	
+	g_free (path);
+	
+	return file;
+}
+
 gchar * 
 ev_tmp_filename (const gchar *prefix)
 {
@@ -161,25 +171,40 @@ ev_tmp_filename_unlink (const gchar *filename)
 }
 
 void
+ev_tmp_file_unlink (GFile *file)
+{
+	gboolean res;
+
+	if (!file)
+		return;
+	
+	res = g_file_delete (file, NULL, NULL);
+	if (!res) {
+		char *uri;
+		
+		uri = g_file_get_uri (file);
+		g_warning ("Unable to delete temp file %s\n", uri);
+		g_free (uri);
+	}
+}
+
+void
 ev_tmp_uri_unlink (const gchar *uri)
 {
-	GnomeVFSURI *vfs_uri;
-	gchar       *filename;
+	GFile       *file;
 	
 	if (!uri)
 		return;
 	
-	vfs_uri = gnome_vfs_uri_new (uri);
-	if (!gnome_vfs_uri_is_local (vfs_uri)) {
-		g_warning ("Attempting to delete non local uri: %s\n", uri);
-		gnome_vfs_uri_unref (vfs_uri);
+	file = g_file_new_for_uri (uri);
+	if (!g_file_is_native (file)) {
+		g_warning ("Attempting to delete non native uri: %s\n", uri);
+		g_object_unref (file);
 		return;
 	}
-	gnome_vfs_uri_unref (vfs_uri);
-
-	filename = g_filename_from_uri (uri, NULL, NULL);
-	ev_tmp_filename_unlink (filename);
-	g_free (filename);
+	
+	ev_tmp_file_unlink (file);
+	g_object_unref (file);
 }
 
 gboolean
@@ -187,31 +212,32 @@ ev_xfer_uri_simple (const char *from,
 		    const char *to,
 		    GError     **error)
 {
-	GnomeVFSResult result;
-	GnomeVFSURI *source_uri;
-	GnomeVFSURI *target_uri;
+	GFile *source_file;
+	GFile *target_file;
+	GError *ioerror;
+	gboolean result;
 	
 	if (!from)
 		return FALSE;
 	
-	source_uri = gnome_vfs_uri_new (from);
-	target_uri = gnome_vfs_uri_new (to);
-
-	result = gnome_vfs_xfer_uri (source_uri, target_uri, 
-				     GNOME_VFS_XFER_DEFAULT | GNOME_VFS_XFER_FOLLOW_LINKS,
-				     GNOME_VFS_XFER_ERROR_MODE_ABORT,
-				     GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE,
-				     NULL,
-				     NULL);
-	gnome_vfs_uri_unref (target_uri);
-	gnome_vfs_uri_unref (source_uri);
+	source_file = g_file_new_for_uri (from);
+	target_file = g_file_new_for_uri (to);
+	
+	result = g_file_copy (source_file, target_file,
+			      G_FILE_COPY_OVERWRITE,
+			      NULL, NULL, NULL, &ioerror);
+
+	g_object_unref (target_file);
+	g_object_unref (source_file);
     
-	if (result != GNOME_VFS_OK)
+	if (!result) {
 		g_set_error (error,
 			     G_FILE_ERROR,
 			     G_FILE_ERROR_FAILED,
-			     gnome_vfs_result_to_string (result));
-	return (result == GNOME_VFS_OK);
+			     ioerror->message);
+		g_error_free (ioerror);
+	}
+	return result;
 
 }
 
diff --git a/libdocument/ev-file-helpers.h b/libdocument/ev-file-helpers.h
index 6aad12a..cd86320 100644
--- a/libdocument/ev-file-helpers.h
+++ b/libdocument/ev-file-helpers.h
@@ -18,10 +18,11 @@
  *  $Id$
  */
 
-#ifndef EPHY_FILE_HELPERS_H
-#define EPHY_FILE_HELPERS_H
+#ifndef EV_FILE_HELPERS_H
+#define EV_FILE_HELPERS_H
 
 #include <glib.h>
+#include <gio/gio.h>
 
 G_BEGIN_DECLS
 
@@ -39,8 +40,10 @@ void         ev_file_helpers_init     (void);
 
 void         ev_file_helpers_shutdown (void);
 
+GFile       *ev_tmp_file_get          (const gchar       *prefix);
 gchar       *ev_tmp_filename          (const char        *prefix);
 void         ev_tmp_filename_unlink   (const gchar       *filename);
+void         ev_tmp_file_unlink       (GFile             *file);
 void         ev_tmp_uri_unlink        (const gchar       *uri);
 
 gboolean     ev_xfer_uri_simple       (const char        *from,
@@ -57,4 +60,4 @@ gchar       *ev_file_compress         (const gchar       *uri,
 
 G_END_DECLS
 
-#endif /* EPHY_FILE_HELPERS_H */
+#endif /* EV_FILE_HELPERS_H */
diff --git a/shell/ev-jobs.c b/shell/ev-jobs.c
index 6ffbb57..d4dc2f1 100644
--- a/shell/ev-jobs.c
+++ b/shell/ev-jobs.c
@@ -16,9 +16,6 @@
 #include <glib/gstdio.h>
 #include <glib/gi18n.h>
 #include <unistd.h>
-#include <libgnomevfs/gnome-vfs-uri.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
 
 static void ev_job_init                 (EvJob               *job);
 static void ev_job_class_init           (EvJobClass          *class);
diff --git a/shell/ev-password.c b/shell/ev-password.c
index b6298f3..56db481 100644
--- a/shell/ev-password.c
+++ b/shell/ev-password.c
@@ -22,10 +22,10 @@
 #endif
 
 #include <glib/gi18n.h>
+#include <gio/gio.h>
 #include <gtk/gtk.h>
 #include <glade/glade.h>
 #include <gnome-keyring.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
 
 #include "ev-password.h"
 
@@ -70,15 +70,16 @@ ev_password_dialog_set_property (GObject      *object,
 	char *format;
 	char *markup;
 	char *base_name;
-	char *file_name;
+	GFile *file;
 
 	switch (prop_id)
 	{
 	case PROP_URI:
 		dialog->priv->uri = g_strdup (g_value_get_string (value));
+		
+		file = g_file_new_for_uri (dialog->priv->uri);
 
-		file_name = gnome_vfs_format_uri_for_display (dialog->priv->uri);
-		base_name = g_path_get_basename (file_name);
+		base_name = g_file_get_basename (file);
 		format = g_strdup_printf ("<span size=\"larger\" weight=\"bold\">%s</span>\n\n%s",
 					  _("Password required"),
 					  _("The document “%s” is locked and requires a password before it can be opened."));
@@ -87,9 +88,9 @@ ev_password_dialog_set_property (GObject      *object,
 		gtk_label_set_markup (GTK_LABEL (dialog->priv->label), markup);
 
 		g_free (base_name);
-		g_free (file_name);
 		g_free (format);
 		g_free (markup);
+		g_object_unref (file);
 
 		ev_password_search_in_keyring (dialog, dialog->priv->uri);
 		break;
@@ -248,7 +249,7 @@ ev_password_dialog_save_password (EvPasswordDialog *dialog)
 	attribute.value.string = g_strdup (dialog->priv->uri);
 	g_array_append_val (attributes, attribute);
 	
-	unescaped_uri = gnome_vfs_unescape_string_for_display (dialog->priv->uri);
+	unescaped_uri = g_uri_unescape_string (dialog->priv->uri, NULL);
 	name = g_strdup_printf (_("Password for document %s"), unescaped_uri);	
 
 	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->check_default))) {
diff --git a/shell/ev-sidebar-attachments.c b/shell/ev-sidebar-attachments.c
index 5d2beff..e2a0261 100644
--- a/shell/ev-sidebar-attachments.c
+++ b/shell/ev-sidebar-attachments.c
@@ -406,6 +406,7 @@ ev_sidebar_attachments_drag_data_get (GtkWidget        *widget,
 		EvAttachment *attachment;
 		GtkTreePath  *path;
 		GtkTreeIter   iter;
+		GFile        *file;
 		gchar        *uri, *filename;
 		GError       *error = NULL;
 		
@@ -420,10 +421,10 @@ ev_sidebar_attachments_drag_data_get (GtkWidget        *widget,
 		filename = g_build_filename (ev_tmp_dir (),
 					     ev_attachment_get_name (attachment),
 					     NULL);
-		
-		uri = g_filename_to_uri (filename, NULL, NULL);
+		file = g_file_new_for_path (filename);
+		uri = g_file_get_uri (file);
 
-		if (ev_attachment_save (attachment, filename, &error)) {
+		if (ev_attachment_save (attachment, file, &error)) {
 			g_string_append (uri_list, uri);
 			g_string_append_c (uri_list, '\n');
 		}
@@ -433,8 +434,10 @@ ev_sidebar_attachments_drag_data_get (GtkWidget        *widget,
 			g_error_free (error);
 		}
 
+		g_free (filename);
 		g_free (uri);
 		gtk_tree_path_free (path);
+		g_object_unref (file);
 		g_object_unref (attachment);
 	}
 
diff --git a/shell/ev-window-title.c b/shell/ev-window-title.c
index 427e696..b43775a 100644
--- a/shell/ev-window-title.c
+++ b/shell/ev-window-title.c
@@ -21,8 +21,8 @@
 #include "ev-window-title.h"
 #include "ev-backends-manager.h"
 
+#include <gio/gio.h>
 #include <glib/gi18n.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
 
 /* Known backends (for bad extensions fix) */
 #define EV_BACKEND_PS  "psdocument"
@@ -65,12 +65,12 @@ ev_window_title_new (EvWindow *window)
 static char *
 get_filename_from_uri (const char *uri)
 {
+	GFile *file;
 	char *filename;
-	char *display_name;
-
-	display_name = gnome_vfs_format_uri_for_display (uri);
-	filename = g_path_get_basename (display_name);
-	g_free (display_name);
+	
+	file = g_file_new_for_uri (uri);
+	filename = g_file_get_basename (file);
+	g_object_unref (file);
 
 	return filename;
 }
diff --git a/shell/ev-window.c b/shell/ev-window.c
index ab8eb1d..8913901 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -82,9 +82,7 @@
 #include <glib/gstdio.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <libgnomevfs/gnome-vfs-async-ops.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
+#include <gio/gio.h>
 #include <gconf/gconf-client.h>
 
 #include <errno.h>
@@ -1300,30 +1298,23 @@ ev_window_clear_print_settings_file (EvWindow *ev_window)
 static void
 ev_window_clear_temp_file (EvWindow *ev_window)
 {
-	GnomeVFSURI *uri;
-	gchar       *filename;
-	const gchar *tempdir;
+	GFile       *file, *tempdir;
+	const gchar *tempdir_path;
 
 	if (!ev_window->priv->uri)
 		return;
 
-	uri = gnome_vfs_uri_new (ev_window->priv->uri);
-	if (!gnome_vfs_uri_is_local (uri)) {
-		gnome_vfs_uri_unref (uri);
-		return;
-	}
-	gnome_vfs_uri_unref (uri);
+	file = g_file_new_for_uri (ev_window->priv->uri);
 
-	filename = g_filename_from_uri (ev_window->priv->uri, NULL, NULL);
-	if (!filename)
-		return;
+	tempdir_path = g_get_tmp_dir ();
+	tempdir = g_file_new_for_path (tempdir_path);
 
-	tempdir = g_get_tmp_dir ();
-	if (g_ascii_strncasecmp (filename, tempdir, strlen (tempdir)) == 0) {
-		g_unlink (filename);
+	if (g_file_contains_file (tempdir, file)) {
+		g_file_delete (file, NULL, NULL);
 	}
 
-	g_free (filename);
+	g_object_unref (file);
+	g_object_unref (tempdir);
 }
 
 /* This callback will executed when load job will be finished.
@@ -1403,15 +1394,16 @@ ev_window_load_job_cb  (EvJobLoad *job,
 
 	if (job->error->domain == EV_DOCUMENT_ERROR &&
 	    job->error->code == EV_DOCUMENT_ERROR_ENCRYPTED) {
-		gchar *base_name, *file_name;
+		GFile *file;
+		gchar *base_name;
 
 		setup_view_from_metadata (ev_window);
 
-		file_name = gnome_vfs_format_uri_for_display (job->uri);
-		base_name = g_path_get_basename (file_name);
+		file = g_file_new_for_uri (job->uri);
+		base_name = g_file_get_basename (file);
 		ev_password_view_set_file_name (EV_PASSWORD_VIEW (ev_window->priv->password_view),
 						base_name);
-		g_free (file_name);
+		g_object_unref (file);
 		g_free (base_name);
 		ev_window_set_page_mode (ev_window, PAGE_MODE_PASSWORD);
 		
@@ -1472,27 +1464,12 @@ ev_window_close_dialogs (EvWindow *ev_window)
 	ev_window->priv->properties = NULL;
 }
 
-static gint
-open_xfer_update_progress_callback (GnomeVFSAsyncHandle      *handle,
-				    GnomeVFSXferProgressInfo *info,
-				    EvWindow                 *ev_window)
-{
-	switch (info->status) {
-	        case GNOME_VFS_XFER_PROGRESS_STATUS_OK:
-			if (info->phase == GNOME_VFS_XFER_PHASE_COMPLETED) {
-				ev_job_queue_add_job (ev_window->priv->load_job, EV_JOB_PRIORITY_HIGH);
-			}
-
-			return 1;
-	        case GNOME_VFS_XFER_PROGRESS_STATUS_VFSERROR:
-	        case GNOME_VFS_XFER_PROGRESS_STATUS_OVERWRITE:
-	        case GNOME_VFS_XFER_PROGRESS_STATUS_DUPLICATE:
-			return 1;
-	        default:
-			g_assert_not_reached ();
-	}
-
-	return 0;
+static void
+open_file_progress_cb (goffset   cur_bytes,
+		       goffset   tot_bytes,
+		       EvWindow *ev_window)
+{
+	/* Do nothing right now */
 }
 
 void
@@ -1504,8 +1481,8 @@ ev_window_open_uri (EvWindow       *ev_window,
 		    gboolean        unlink_temp_file,
 		    const gchar    *print_settings)
 {
-	GnomeVFSURI *source_uri;
-	GnomeVFSURI *target_uri;
+	GFile *source_file;
+	GFile *target_file;
 
 	if (ev_window->priv->uri &&
 	    g_ascii_strcasecmp (ev_window->priv->uri, uri) == 0) {
@@ -1537,11 +1514,9 @@ ev_window_open_uri (EvWindow       *ev_window,
 			  G_CALLBACK (ev_window_load_job_cb),
 			  ev_window);
 
-	source_uri = gnome_vfs_uri_new (uri);
-	if (!gnome_vfs_uri_is_local (source_uri) && !ev_window->priv->local_uri) {
-		GnomeVFSAsyncHandle *handle;
-		GList               *slist = NULL;
-		GList               *tlist = NULL;
+	source_file = g_file_new_for_uri (uri);
+	if (!g_file_is_native (source_file) && !ev_window->priv->local_uri) {
+		gboolean             result;
 		char                *tmp_name;
 		char                *base_name;
 
@@ -1549,36 +1524,31 @@ ev_window_open_uri (EvWindow       *ev_window,
 		 * it helps to resolve some mime types, say cbz */
 
 		tmp_name = ev_tmp_filename (NULL);
-		base_name = gnome_vfs_uri_extract_short_name (source_uri);
+		base_name = g_file_get_basename (source_file);
 		ev_window->priv->local_uri = g_strconcat ("file:", tmp_name, "-", base_name, NULL);
 		ev_job_load_set_uri (EV_JOB_LOAD (ev_window->priv->load_job),
 				     ev_window->priv->local_uri);
 		g_free (base_name);
 		g_free (tmp_name);
 		
-		target_uri = gnome_vfs_uri_new (ev_window->priv->local_uri);
+		target_file = g_file_new_for_uri (ev_window->priv->local_uri);
 		
-		slist = g_list_prepend (slist, source_uri);
-		tlist = g_list_prepend (tlist, target_uri);
-		gnome_vfs_async_xfer (&handle, slist, tlist,
-				      GNOME_VFS_XFER_DEFAULT | GNOME_VFS_XFER_FOLLOW_LINKS,
-				      GNOME_VFS_XFER_ERROR_MODE_ABORT,
-				      GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE,
-				      GNOME_VFS_PRIORITY_DEFAULT,
-				      (GnomeVFSAsyncXferProgressCallback)
-				      open_xfer_update_progress_callback,
+		/* FIXME: we should make this async. In gnome-vfs it was. */
+		result = g_file_copy (source_file, target_file,
+				      0, NULL,
+				      (GFileProgressCallback) open_file_progress_cb,
 				      ev_window,
-				      NULL, NULL); 
-		
-		g_list_free (slist);
-		g_list_free (tlist);
-		gnome_vfs_uri_unref (target_uri);
-		gnome_vfs_uri_unref (source_uri);
-		
+				      NULL);
+		if (result) {
+			ev_job_queue_add_job (ev_window->priv->load_job, EV_JOB_PRIORITY_HIGH);
+		}
+
+		g_object_unref (source_file);
+		g_object_unref (target_file);
 		return;
 	}
 
-	gnome_vfs_uri_unref (source_uri);
+	g_object_unref (source_file);
 	ev_job_queue_add_job (ev_window->priv->load_job, EV_JOB_PRIORITY_HIGH);
 }
 
@@ -1936,79 +1906,53 @@ ev_window_setup_recent (EvWindow *ev_window)
 	g_list_free (items);
 }
 
-static gint
-save_xfer_update_progress_callback (GnomeVFSAsyncHandle      *handle,
-				    GnomeVFSXferProgressInfo *info,
-				    GnomeVFSURI              *tmp_uri)
-{
-	switch (info->status) {
-	        case GNOME_VFS_XFER_PROGRESS_STATUS_OK:
-			if (info->phase == GNOME_VFS_XFER_PHASE_COMPLETED) {
-				gchar *uri;
-
-				uri = gnome_vfs_uri_to_string (tmp_uri, 0);
-				ev_tmp_uri_unlink (uri);
-				g_free (uri);
-				gnome_vfs_uri_unref (tmp_uri);
-			}
-			return 1;
-	        case GNOME_VFS_XFER_PROGRESS_STATUS_VFSERROR:
-			if (info->vfs_status != GNOME_VFS_OK) {
-				GtkWidget *dialog;
-				gchar     *uri;
-
-				dialog = gtk_message_dialog_new (NULL,
-								 GTK_DIALOG_DESTROY_WITH_PARENT,
-								 GTK_MESSAGE_ERROR,
-								 GTK_BUTTONS_CLOSE,
-								 _("The file could not be saved as “%s”."),
-								 info->target_name);
-				gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-									  gnome_vfs_result_to_string (info->vfs_status));
-
-				g_signal_connect (dialog, "response",
-						  G_CALLBACK (gtk_widget_destroy),
-						  NULL);
-				gtk_widget_show (dialog);
-
-				uri = gnome_vfs_uri_to_string (tmp_uri, 0);
-				ev_tmp_uri_unlink (uri);
-				g_free (uri);
-				gnome_vfs_uri_unref (tmp_uri);
-			}
-			return 1;
-	        case GNOME_VFS_XFER_PROGRESS_STATUS_OVERWRITE:
-	        case GNOME_VFS_XFER_PROGRESS_STATUS_DUPLICATE:
-			return 1;
-	        default:
-			g_assert_not_reached ();
-	}
-
-	return 0;
+static void
+save_copy_progress_cb (goffset cur_bytes,
+		       goffset tot_bytes)
+{
+	/* Do nothing now */
 }
 
 static void
 ev_window_save_remote (EvWindow    *ev_window,
-		       GnomeVFSURI *src,
-		       GnomeVFSURI *dst)
-{
-	GnomeVFSAsyncHandle *handle;
-	GList               *slist = NULL;
-	GList               *tlist = NULL;
-	
-	slist = g_list_prepend (slist, src);
-	tlist = g_list_prepend (tlist, dst);
-	gnome_vfs_async_xfer (&handle, slist, tlist,
-			      GNOME_VFS_XFER_DEFAULT | GNOME_VFS_XFER_FOLLOW_LINKS,
-			      GNOME_VFS_XFER_ERROR_MODE_ABORT,
-			      GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE,
-			      GNOME_VFS_PRIORITY_DEFAULT,
-			      (GnomeVFSAsyncXferProgressCallback)
-			      save_xfer_update_progress_callback,
-			      gnome_vfs_uri_ref (src),
-			      NULL, NULL);
-	g_list_free (slist);
-	g_list_free (tlist);
+		       GFile       *src,
+		       GFile       *dst)
+{
+	GError *err;
+	gboolean res;
+	
+	/* FIXME: make this async as it was in gnome-vfs */
+	res = g_file_copy (src, dst,
+			   G_FILE_COPY_OVERWRITE,
+			   NULL,
+			   (GFileProgressCallback) save_copy_progress_cb,
+			   NULL,
+			   &err);
+	if (!res) {
+		GtkWidget *dialog;
+		gchar     *name;
+
+		name = g_file_get_basename (dst);
+		dialog = gtk_message_dialog_new (NULL,
+						 GTK_DIALOG_DESTROY_WITH_PARENT,
+						 GTK_MESSAGE_ERROR,
+						 GTK_BUTTONS_CLOSE,
+						 _("The file could not be saved as “%s”."),
+						 name);
+		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+							  err->message);
+		g_signal_connect (dialog, "response",
+				  G_CALLBACK (gtk_widget_destroy),
+				  NULL);
+		gtk_widget_show (dialog);
+		ev_tmp_file_unlink (src);
+		g_object_unref (src);
+		g_free (name);
+	} else {
+		ev_tmp_file_unlink (src);
+		g_object_unref (src);
+	}
+		
 }
 
 static void
@@ -2074,7 +2018,7 @@ ev_window_cmd_save_as (GtkAction *action, EvWindow *ev_window)
 {
 	GtkWidget *fc;
 	gchar *base_name;
-	gchar *file_name;
+	GFile *file;
 #if GLIB_CHECK_VERSION (2, 13, 3)
 	const gchar *folder;
 #else
@@ -2092,9 +2036,9 @@ ev_window_cmd_save_as (GtkAction *action, EvWindow *ev_window)
 	gtk_dialog_set_default_response (GTK_DIALOG (fc), GTK_RESPONSE_OK);
 
 	gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (fc), FALSE);
-	gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (fc), TRUE);	
-	file_name = gnome_vfs_format_uri_for_display (ev_window->priv->uri);
-	base_name = g_path_get_basename (file_name);
+	gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (fc), TRUE);
+	file = g_file_new_for_uri (ev_window->priv->uri);
+	base_name = g_file_get_basename (file);
 	gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (fc), base_name);
 	
 #if GLIB_CHECK_VERSION (2, 13, 3)
@@ -2107,7 +2051,7 @@ ev_window_cmd_save_as (GtkAction *action, EvWindow *ev_window)
 	free (folder);
 #endif
 	
-	g_free (file_name);
+	g_object_unref (file);
 	g_free (base_name);
         
 	g_signal_connect (fc, "response",
@@ -4782,31 +4726,48 @@ static void
 launch_action (EvWindow *window, EvLinkAction *action)
 {
 	const char *filename = ev_link_action_get_filename (action);
-	char *uri = NULL;
+	const char *content_type;
+	GAppInfo *app_info;
+	GFileInfo *file_info;
+	GFile *file;
+	GList *file_list = NULL;
+	
+	if (filename == NULL)
+		return;
 
-	if (filename  && g_path_is_absolute (filename)) {
-		uri = gnome_vfs_get_uri_from_local_path (filename);
+	if (g_path_is_absolute (filename)) {
+		file = g_file_new_for_path (filename);
 	} else {
-		GnomeVFSURI *base_uri, *resolved_uri;
-
-		base_uri = gnome_vfs_uri_new (window->priv->uri);
-		if (base_uri && filename) {
-			resolved_uri = gnome_vfs_uri_resolve_relative (base_uri, filename);	
-			if (resolved_uri) {
-				uri = gnome_vfs_uri_to_string (resolved_uri, GNOME_VFS_URI_HIDE_NONE);
-				gnome_vfs_uri_unref (resolved_uri);
-			}
-			gnome_vfs_uri_unref (base_uri);
-		}
+		GFile *base_file;
+		
+		base_file = g_file_new_for_uri (window->priv->uri);
+		file = g_file_resolve_relative_path (base_file,
+						     filename);
+		
+		g_object_unref (base_file);
 	}
-
-	if (uri) {
-		gnome_vfs_url_show (uri);
-	} else {
-		gnome_vfs_url_show (filename);
+	
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+				       0, NULL, NULL);
+	if (file_info == NULL) {
+		g_object_unref (file);
+		return;
 	}
+	
+	content_type = g_file_info_get_content_type (file_info);
+	app_info = g_app_info_get_default_for_type (content_type, TRUE);
+	
+	file_list = g_list_append (file_list, file);
 
-	g_free (uri);
+	/* FIXME: should we use a GAppLaunchContext? */
+	g_app_info_launch (app_info, file_list,
+			   NULL, NULL);
+	
+	g_list_free (file_list);
+	g_object_unref (app_info);
+	g_object_unref (file_info);
+	g_object_unref (file);
 
 	/* According to the PDF spec filename can be an executable. I'm not sure
 	   allowing to launch executables is a good idea though. -- marco */
@@ -4816,37 +4777,50 @@ static void
 launch_external_uri (EvWindow *window, EvLinkAction *action)
 {
 	const gchar *uri = ev_link_action_get_uri (action);
-	GnomeVFSResult result = gnome_vfs_url_show (uri);
-	GtkWidget *dialog;
-	gchar* message = NULL;
-
-	switch(result) {
-		case GNOME_VFS_OK:
-			break;
-		case GNOME_VFS_ERROR_BAD_PARAMETERS:
-			message = _("Invalid URI: “%s”");
-			break;
-		case GNOME_VFS_ERROR_NOT_SUPPORTED:
-			message = _("Unsupported URI: “%s”");
-			break;
-		default:
-			message = _("Unknown error");
+	const char *content_type;
+	GFile *file;
+	GFileInfo *file_info;
+	GAppInfo *app;
+	GList *file_list = NULL;
+	gboolean res;
+	GError *error;
+	
+	file = g_file_new_for_uri (uri);
+	file_info = g_file_query_info (file,
+				       G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+				       0, NULL, NULL);
+	if (file_info == NULL)
+	{
+		g_object_unref (file);
+		return;
 	}
-	if(message) {
+	content_type = g_file_info_get_content_type (file_info);
+	g_object_unref (file_info);
+	app = g_app_info_get_default_for_type (content_type,
+					       TRUE);
+	file_list = g_list_append (file_list, file);
+	res = g_app_info_launch (app,
+				 file_list,
+				 NULL, &error);
+	
+	if (!res) {
+		GtkWidget *dialog;
+	
 		dialog = gtk_message_dialog_new (GTK_WINDOW (window),
 						 GTK_DIALOG_DESTROY_WITH_PARENT,
 						 GTK_MESSAGE_ERROR,
 						 GTK_BUTTONS_CLOSE,
 						 _("Unable to open external link"));
 		gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-							  message, uri);
+							  error->message, uri);
 		g_signal_connect (dialog, "response",
 				  G_CALLBACK (gtk_widget_destroy),
 				  NULL);
 		gtk_widget_show (dialog);
-
 	}
-	return;
+	g_object_unref (app);
+	g_object_unref (file);
+	g_list_free (file_list);
 }
 
 static void
@@ -4978,8 +4952,8 @@ image_save_dialog_response_cb (GtkWidget *fc,
 			       gint       response_id,
 			       EvWindow  *ev_window)
 {
-	GnomeVFSURI  *target_uri;
-	gboolean      is_local;
+	GFile        *target_file;
+	gboolean      is_native;
 	GError       *error = NULL;
 
 	gchar        *uri;
@@ -5018,11 +4992,11 @@ image_save_dialog_response_cb (GtkWidget *fc,
 	g_strfreev(extensions);
 	file_format = gdk_pixbuf_format_get_name (format);
 	
-	target_uri = gnome_vfs_uri_new (uri_extension);
-	is_local = gnome_vfs_uri_is_local (target_uri);
+	target_file = g_file_new_for_uri (uri_extension);
+	is_native = g_file_is_native (target_file);
 	
-	if (is_local) {
-		filename = g_filename_from_uri (uri_extension, NULL, NULL);
+	if (is_native) {
+		filename = g_file_get_path (target_file);
 	} else {
 		filename = ev_tmp_filename ("saveimage");
 	}
@@ -5039,25 +5013,23 @@ image_save_dialog_response_cb (GtkWidget *fc,
 					 error);
 		g_error_free (error);
 		g_free (filename);
-		gnome_vfs_uri_unref (target_uri);
+		g_object_unref (target_file);
 		gtk_widget_destroy (fc);
 
 		return;
 	}
 
-	if (!is_local) {
-		GnomeVFSURI *source_uri;
-		gchar       *local_uri;
-
-		local_uri = g_filename_to_uri (filename, NULL, NULL);
-		source_uri = gnome_vfs_uri_new (local_uri);
-		g_free (local_uri);
-		ev_window_save_remote (ev_window, source_uri, target_uri);
-		gnome_vfs_uri_unref (source_uri);
+	if (!is_native) {
+		GFile       *source_file;
+		
+		source_file = g_file_new_for_uri (filename);
+		
+		ev_window_save_remote (ev_window, source_file, target_file);
+		g_object_unref (source_file);
 	}
 	
 	g_free (filename);
-	gnome_vfs_uri_unref (target_uri);
+	g_object_unref (target_file);
 	gtk_widget_destroy (fc);
 }
 
@@ -5134,12 +5106,12 @@ attachment_save_dialog_response_cb (GtkWidget *fc,
 				    gint       response_id,
 				    EvWindow  *ev_window)
 {
-	GnomeVFSURI          *target_uri;
+	GFile                *target_file;
 	gchar                *uri;
 	GList                *l;
 	GtkFileChooserAction  fc_action;
 	gboolean              is_dir;
-	gboolean              is_local;
+	gboolean              is_native;
 	
 	if (response_id != GTK_RESPONSE_OK) {
 		gtk_widget_destroy (fc);
@@ -5147,69 +5119,61 @@ attachment_save_dialog_response_cb (GtkWidget *fc,
 	}
 
 	uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (fc));
-	target_uri = gnome_vfs_uri_new (uri);
+	target_file = g_file_new_for_uri (uri);
 	g_object_get (G_OBJECT (fc), "action", &fc_action, NULL);
 	is_dir = (fc_action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
-	is_local = gnome_vfs_uri_is_local (target_uri);
+	is_native = g_file_is_native (target_file);
 	
 	for (l = ev_window->priv->attach_list; l && l->data; l = g_list_next (l)) {
 		EvAttachment *attachment;
-		gchar        *filename;
+		GFile        *save_to;
 		GError       *error = NULL;
 		
 		attachment = (EvAttachment *) l->data;
 
-		if (is_local) {
+		if (is_native) {
 			if (is_dir) {
-				filename = g_strjoin ("/", uri,
-						      ev_attachment_get_name (attachment),
-						      NULL);
+				save_to = g_file_get_child (target_file,
+							    ev_attachment_get_name (attachment));
 			} else {
-				filename = g_strdup (uri);
+				save_to = g_object_ref (target_file);
 			}
 		} else {
-			filename = ev_tmp_filename ("saveattachment");
+			save_to = ev_tmp_file_get ("saveattachment");
 		}
 
-		ev_attachment_save (attachment, filename, &error);
+		ev_attachment_save (attachment, save_to, &error);
 		
 		if (error) {
 			ev_window_error_message (GTK_WINDOW (ev_window),
 						 _("The attachment could not be saved."),
 						 error);
 			g_error_free (error);
-			g_free (filename);
+			g_object_unref (save_to);
 
 			continue;
 		}
 
-		if (!is_local) {
-			GnomeVFSURI *src_uri;
-			GnomeVFSURI *dest_uri;
-			gchar       *local_uri;
+		if (!is_native) {
+			GFile       *dest_file;
 
 			if (is_dir) {
 				const gchar *name = ev_attachment_get_name (attachment);
-
-				dest_uri = gnome_vfs_uri_append_file_name (target_uri,
-									   name);
+				dest_file = g_file_get_child (target_file,
+							      name);
 			} else {
-				dest_uri = gnome_vfs_uri_ref (target_uri);
+				dest_file = g_object_ref (target_file);
 			}
-			
-			local_uri = g_filename_to_uri (filename, NULL, NULL);
-			src_uri = gnome_vfs_uri_new (local_uri);
-			g_free (local_uri);
-			ev_window_save_remote (ev_window, src_uri, dest_uri);
-			gnome_vfs_uri_unref (src_uri);
-			gnome_vfs_uri_unref (dest_uri);
-		}
 
-		g_free (filename);
+			ev_window_save_remote (ev_window, save_to, dest_file);
+
+			g_object_unref (save_to);
+			g_object_unref (dest_file);
+		}
 	}
 
 	g_free (uri);
-	gnome_vfs_uri_unref (target_uri);
+	g_object_unref (target_file);
 
 	gtk_widget_destroy (fc);
 }
diff --git a/shell/main.c b/shell/main.c
index e4c2d1b..ac61b73 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -35,9 +35,6 @@
 #include <libgnomeui/gnome-authentication-manager.h>
 #endif
 
-#include <libgnomevfs/gnome-vfs-init.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-
 #ifdef ENABLE_DBUS
 #include <dbus/dbus-glib-bindings.h>
 #endif
@@ -203,10 +200,14 @@ load_files (const char **files,
 		char   *uri;
 		char   *label;
 		GValue *old = NULL;
+		GFile  *file;
+
+		file = g_file_new_for_commandline_arg (files[i]);
+		uri = g_file_get_uri (file);
 
-		uri = gnome_vfs_make_uri_from_shell_arg (files[i]);
+		g_object_unref (file);
 		
-		label = strchr (uri, GNOME_VFS_URI_MAGIC_CHR);
+		label = strchr (uri, '#');
 
 		if (label) {
 			GValue *new;
@@ -282,9 +283,13 @@ load_files_remote (const char **files,
 
 	for (i = 0; files[i]; i++) {
 		const char *page_label;
+		GFile *file;
 		char *uri;
 
-		uri = gnome_vfs_make_uri_from_shell_arg (files[i]);
+		file = g_file_new_for_commandline_arg (files[i]);
+		uri = g_file_get_uri (file);
+		g_object_unref (file);
+
 		page_label = ev_page_label ? ev_page_label : "";
 
 		if (!dbus_g_proxy_call (remote_object, "OpenURI", &error,
@@ -353,8 +358,6 @@ main (int argc, char *argv[])
 		return 1;
 	}
 	g_option_context_free (context);
-	
-	gnome_vfs_init ();
 
 	accel_filename = g_build_filename (ev_dot_dir (), "accels", NULL);
 	gtk_accel_map_load (accel_filename);
diff --git a/thumbnailer/evince-thumbnailer.c b/thumbnailer/evince-thumbnailer.c
index b192d26..d4d1a24 100644
--- a/thumbnailer/evince-thumbnailer.c
+++ b/thumbnailer/evince-thumbnailer.c
@@ -17,11 +17,6 @@
 */
 
 #include <config.h>
-#include <libgnomevfs/gnome-vfs-mime-utils.h>
-#include <libgnomevfs/gnome-vfs-uri.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-#include <libgnomevfs/gnome-vfs-init.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
 
 #include <ev-document.h>
 #include <ev-document-thumbnails.h>
@@ -29,6 +24,8 @@
 #include <ev-document-factory.h>
 #include <ev-backends-manager.h>
 
+#include <gio/gio.h>
+
 #include <stdlib.h>
 #include <string.h>
 
@@ -138,6 +135,7 @@ main (int argc, char *argv[])
 	const char *output;
 	int         size;
 	char       *uri;
+	GFile      *file;
 
 	if (argc <= 2 || argc > 5 || strcmp (argv[1], "-h") == 0 ||
 	    strcmp (argv[1], "--help") == 0) {
@@ -162,13 +160,14 @@ main (int argc, char *argv[])
 
 	if (!g_thread_supported ())
 		g_thread_init (NULL);
-	
-	gnome_vfs_init ();
 
 	ev_backends_manager_init ();
 
-	uri = gnome_vfs_make_uri_from_shell_arg (input);
+	file = g_file_new_for_commandline_arg (input);
+	uri = g_file_get_uri (file);
 	document = evince_thumbnailer_get_document (uri);
+
+	g_object_unref (file);
 	g_free (uri);
 
 	if (!document) {
