Index: appearance-main.c
===================================================================
--- appearance-main.c	(revision 8703)
+++ appearance-main.c	(working copy)
@@ -49,7 +49,7 @@ init_appearance_data (int *argc, char **
   g_thread_init (NULL);
   theme_thumbnail_factory_init (*argc, *argv);
   gtk_init (argc, argv);
-  gnome_vfs_init ();
+
   activate_settings_daemon ();
 
   /* set up the data */
Index: theme-installer.c
===================================================================
--- theme-installer.c	(revision 8703)
+++ theme-installer.c	(working copy)
@@ -26,11 +26,14 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <gio/gio.h>
+#include <glib/gstdio.h>
 
 #include "file-transfer-dialog.h"
 #include "theme-installer.h"
 #include "theme-util.h"
 
+#define CHUNK_SIZE 1024
+
 enum {
 	THEME_INVALID,
 	THEME_ICON,
@@ -49,16 +52,43 @@ enum {
 };
 
 static void
-cleanup_tmp_dir (const gchar *tmp_dir)
-{
-	if (gnome_vfs_remove_directory (tmp_dir) == GNOME_VFS_ERROR_DIRECTORY_NOT_EMPTY) {
-		GList *list;
+cleanup_tmp_dir (GIOSchedulerJob *job,
+		 GCancellable *cancellable,
+		 gpointer user_data)
+{
+	GFile *directory;
+	GFileEnumerator *enumerator;
+	gchar *tmp_dir;
+
+	tmp_dir = (gchar *) user_data;
+
+	directory = g_file_new_for_path (tmp_dir);
+	enumerator = g_file_enumerate_children (directory,
+			G_FILE_ATTRIBUTE_STANDARD_NAME,
+			G_FILE_QUERY_INFO_NONE,
+			NULL, NULL);
+
+	if (G_IS_FILE_ENUMERATOR (enumerator)) {
+		GFileInfo *info;
+
+		/* GIO does not have a way to remove a list of files. So lets delete
+		 * each file into the temporary dir. */
+		while ((info = g_file_enumerator_next_file (enumerator, NULL, NULL))) {
+			GFile *todelete;
+			const gchar *filename;
+
+			filename = g_file_info_get_name (info);
+			todelete = g_file_get_child (directory, filename);
+			g_object_unref (info);
 
-		list = g_list_prepend (NULL, gnome_vfs_uri_new (tmp_dir));
-		gnome_vfs_xfer_delete_list (list, GNOME_VFS_XFER_RECURSIVE,
-					GNOME_VFS_XFER_ERROR_MODE_ABORT, NULL, NULL);
-		gnome_vfs_uri_list_free (list);
+			g_file_delete (todelete, NULL, NULL);
+			g_object_unref (todelete);
+		}
+		g_file_enumerator_close (enumerator, NULL, NULL);
 	}
+
+	g_file_delete (directory, NULL, NULL);
+	g_object_unref (directory);
 }
 
 static int
@@ -76,14 +106,31 @@ file_theme_type (const gchar *dir)
 	if (exists) {
 		GPatternSpec *pattern = NULL;
 		gchar *file_contents = NULL;
-		gint file_size;
-		gchar *uri;
+		gsize bytes_read;
+		gint total_file_size;
+		GFile *theme_file;
+		GInputStream *input_stream;
 		gboolean match;
 
-		uri = gnome_vfs_get_uri_from_local_path (filename);
-		g_free (filename);
-		gnome_vfs_read_entire_file (uri, &file_size, &file_contents);
-		g_free (uri);
+		theme_file = g_file_new_for_path (filename);
+		input_stream = G_INPUT_STREAM (g_file_read (theme_file, NULL, NULL));
+		total_file_size = bytes_read = 0;
+
+		while (TRUE) {
+                        GError *error = NULL;
+
+			file_contents = g_realloc (file_contents, total_file_size + CHUNK_SIZE);
+			bytes_read = g_input_stream_read (input_stream, file_contents + total_file_size,
+							  CHUNK_SIZE, NULL, &error);
+
+			total_file_size += bytes_read;
+			if (bytes_read == 0)
+				break;
+                }
+		g_input_stream_close (input_stream, NULL, NULL);
+
+		file_contents = g_realloc (file_contents, total_file_size + 1);
+		file_contents[total_file_size] = '\0';
 
 		pattern = g_pattern_spec_new ("*[Icon Theme]*");
 		match = g_pattern_match_string (pattern, file_contents);
@@ -153,7 +200,12 @@ file_theme_type (const gchar *dir)
 static void
 transfer_cancel_cb (GtkWidget *dlg, gchar *path)
 {
-	gnome_vfs_unlink (path);
+	GFile *todelete;
+
+	todelete = g_file_new_for_path (path);
+	g_file_delete (todelete, NULL, NULL);
+
+	g_object_unref (todelete);
 	g_free (path);
 	gtk_widget_destroy (dlg);
 }
@@ -259,8 +311,7 @@ gnome_theme_install_real (gint filetype,
 {
 	gboolean success = TRUE;
 	GtkWidget *dialog, *apply_button;
-	int xfer_options;
-	GnomeVFSURI *theme_source_dir, *theme_dest_dir;
+	GFile *theme_source_dir, *theme_dest_dir;
 	gint theme_type;
 	gchar *user_message = NULL;
 	gchar *target_dir = NULL;
@@ -307,13 +358,25 @@ gnome_theme_install_real (gint filetype,
 		    && (file_theme_type (path) == THEME_ICON))
 		{
 			gchar *new_path, *update_icon_cache;
+			GFile *new_file;
+			GFile *src_file;
+
+                        src_file = g_file_new_for_path (path);
 
 			new_path = g_build_path (G_DIR_SEPARATOR_S,
 						 g_get_home_dir (),
 						 ".icons",
 						 theme_name, NULL);
+			new_file = g_file_new_for_path (new_path);
+
 			/* XXX: make some noise if we couldn't install it? */
-			gnome_vfs_move (path, new_path, FALSE);
+			if (!g_file_move (src_file, new_file, G_FILE_COPY_NONE,
+					  NULL, NULL, NULL, NULL)) {
+				/* is this noise enough? */
+				g_warning ("Error while coping file");
+			}
+			g_object_unref (new_file);
+			g_object_unref (src_file);
 
 			/* update icon cache - shouldn't really matter if this fails */
 			update_icon_cache = g_strdup_printf ("gtk-update-icon-cache %s", new_path);
@@ -326,17 +389,12 @@ gnome_theme_install_real (gint filetype,
 	}
 
 	/* Move the dir to the target dir */
-	theme_source_dir = gnome_vfs_uri_new (tmp_dir);
-	theme_dest_dir = gnome_vfs_uri_new (target_dir);
+	theme_source_dir = g_file_new_for_path (tmp_dir);
+	theme_dest_dir = g_file_new_for_path (target_dir);
 
-	xfer_options = GNOME_VFS_XFER_RECURSIVE;
-	if (filetype != DIRECTORY)
-		xfer_options |= GNOME_VFS_XFER_REMOVESOURCE;
-
-	if (gnome_vfs_xfer_uri (theme_source_dir, theme_dest_dir, xfer_options,
-				GNOME_VFS_XFER_ERROR_MODE_ABORT,
-				GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE,
-				NULL, NULL) != GNOME_VFS_OK) {
+	if (!g_file_move (theme_source_dir, theme_dest_dir,
+			  G_FILE_COPY_OVERWRITE, NULL, NULL,
+			  NULL, NULL)) {
 		gchar *str;
 
 		str = g_strdup_printf (_("Installation for theme \"%s\" failed."), theme_name);
@@ -480,7 +538,7 @@ transfer_done_cb (GtkWidget *dlg, gchar 
 					   g_get_home_dir (),
 					   g_random_int ());
 
-		if ((gnome_vfs_make_directory (tmp_dir, 0700)) != GNOME_VFS_OK) {
+		if ((g_mkdir (tmp_dir, 0700)) != 0) {
 			dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR,
 							GTK_BUTTONS_OK,
 							_("Failed to create temporary directory"));
@@ -495,13 +553,21 @@ transfer_done_cb (GtkWidget *dlg, gchar 
 		if (!transfer_done_archive (filetype, tmp_dir, path) ||
 		    ((dir = g_dir_open (tmp_dir, 0, NULL)) == NULL))
 		{
-			cleanup_tmp_dir (tmp_dir);
+			g_io_scheduler_push_job ((GIOSchedulerJobFunc) cleanup_tmp_dir,
+						 (gpointer) tmp_dir, NULL,
+						 G_PRIORITY_DEFAULT, NULL);
 			g_free (tmp_dir);
 			g_free (path);
 			return;
 		}
 
-		gnome_vfs_unlink (path);
+		{
+			GFile *todelete;
+
+			todelete = g_file_new_for_path (path);
+			g_file_delete (todelete, NULL, NULL);
+			g_object_unref (todelete);
+		}
 
 		/* See whether we have multiple themes to install. If so,
 		 * we won't ask the user whether to apply the new theme
@@ -547,8 +613,9 @@ transfer_done_cb (GtkWidget *dlg, gchar 
 			gtk_dialog_run (GTK_DIALOG (dialog));
 			gtk_widget_destroy (dialog);
 		}
-
-		cleanup_tmp_dir (tmp_dir);
+		g_io_scheduler_push_job ((GIOSchedulerJobFunc) cleanup_tmp_dir,
+					 (gpointer) tmp_dir, NULL,
+					 G_PRIORITY_DEFAULT, NULL);
 		g_free (tmp_dir);
 	}
 
