Index: src/file-transfer-dialog.c
===================================================================
--- src/file-transfer-dialog.c	(revisione 1350)
+++ src/file-transfer-dialog.c	(copia locale)
@@ -27,9 +27,8 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
+#include <gio/gio.h>
 #include <gtk/gtk.h>
-#include <libgnomevfs/gnome-vfs-async-ops.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
 #include <limits.h>
 
 #include "file-transfer-dialog.h"
@@ -62,7 +61,7 @@ struct _FileTransferDialogPrivate
 	GtkWidget *to;
 	guint nth;
 	guint total;
-	GnomeVFSAsyncHandle *handle;
+	GCancellable *cancellable;
 };
 
 static GObjectClass *parent_class;
@@ -70,10 +69,11 @@ static GObjectClass *parent_class;
 static void
 file_transfer_dialog_cancel (FileTransferDialog *dlg)
 {
-	if (dlg->priv->handle)
+	if (dlg->priv->cancellable)
 	{
-		gnome_vfs_async_cancel (dlg->priv->handle);
-		dlg->priv->handle = NULL;
+		g_cancellable_cancel (dlg->priv->cancellable);
+		g_object_unref (dlg->priv->cancellable);
+		dlg->priv->cancellable = NULL;
 	}
 }
 
@@ -117,7 +117,7 @@ file_transfer_dialog_set_prop (GObject *
 	{
 	case PROP_FROM_URI:
 		base = g_path_get_basename (g_value_get_string (value));
-		escaped = gnome_vfs_unescape_string_for_display (base);
+		escaped = g_uri_unescape_string (base, NULL);
 
 		str = g_strdup_printf (_("Copying '%s'"), escaped);
 		str2 = g_strdup_printf ("<i>%s</i>", str);
@@ -129,7 +129,7 @@ file_transfer_dialog_set_prop (GObject *
 		g_free (str2);
 
 		base = g_path_get_dirname (g_value_get_string (value));
-		escaped = gnome_vfs_format_uri_for_display (base);
+		escaped = g_uri_unescape_string (base, NULL);
 
 		gtk_label_set_text (GTK_LABEL (dlg->priv->from),
 				    escaped);
@@ -138,7 +138,7 @@ file_transfer_dialog_set_prop (GObject *
 		break;
 	case PROP_TO_URI:
 		base = g_path_get_dirname (g_value_get_string (value));
-		escaped = gnome_vfs_format_uri_for_display (base);
+		escaped = g_uri_unescape_string (base, NULL);
 
 		gtk_label_set_text (GTK_LABEL (dlg->priv->to),
 				    escaped);
@@ -411,83 +411,71 @@ file_transfer_dialog_new (void)
 					 NULL));
 }
 
-static int
-file_transfer_dialog_update_cb (GnomeVFSAsyncHandle *handle,
-				GnomeVFSXferProgressInfo *info,
-				gpointer data)
-{
-	FileTransferDialog *dlg = FILE_TRANSFER_DIALOG (data);
+static void
+file_transfer_progress_cb (goffset cur_bytes,
+			   goffset total_bytes,
+			   FileTransferDialog *dlg)
+{
+	g_object_set (G_OBJECT (dlg),
+		      "fraction_complete", cur_bytes / total_bytes,
+		      NULL);
 
-	if (info->status == GNOME_VFS_XFER_PROGRESS_STATUS_VFSERROR)
-		return GNOME_VFS_XFER_ERROR_ACTION_ABORT;
-		
-	if (info->source_name)
-		g_object_set (G_OBJECT (dlg),
-			      "from_uri", info->source_name,
-			      NULL);
-	if (info->target_name)
-		g_object_set (G_OBJECT (dlg),
-			      "to_uri", info->target_name,
-			      NULL);
-
-	if (info->bytes_total)
-		g_object_set (G_OBJECT (dlg),
-			      "fraction_complete", (double) info->total_bytes_copied / (double) info->bytes_total,
-			      NULL);
-
-	if (info->file_index && info->files_total)
-		g_object_set (G_OBJECT (dlg),
-			      "nth_uri", info->file_index,
-			      "total_uris", info->files_total,
-			      NULL);
-	
-	switch (info->phase)
-	{
-	case GNOME_VFS_XFER_PHASE_INITIAL:
-		{
-			char *str = g_strdup_printf ("<i>%s</i>", _("Connecting..."));
-			gtk_label_set_markup (GTK_LABEL (dlg->priv->current),
-					      str);
-			g_free (str);
-		}
-		break;
-	case GNOME_VFS_XFER_PHASE_READYTOGO:
-	case GNOME_VFS_XFER_PHASE_OPENSOURCE:
-		break;
-	case GNOME_VFS_XFER_PHASE_COMPLETED:
+	if (cur_bytes == total_bytes)
 		g_signal_emit (G_OBJECT (dlg),
 			       file_transfer_dialog_signals[DONE],
 			       0, NULL);
-		return 0;
-	default:
-		break;
-	}
+}
+
+static void
+file_transfer_async_ready_cb (GFile *source_file,
+			      GAsyncResult *res,
+			      FileTransferDialog *dlg)
+{
+	gboolean result;
+	GError *error;
 
-	return 1;
+	result = g_file_copy_finish (source_file,
+				     res,
+				     &error);
 }
 
-GnomeVFSResult
+void
 file_transfer_dialog_wrap_async_xfer (FileTransferDialog *dlg,
-				      GList *source_uri_list,
-				      GList *target_uri_list,
-				      GnomeVFSXferOptions xfer_options,
-				      GnomeVFSXferErrorMode error_mode,
-				      GnomeVFSXferOverwriteMode overwrite_mode,
-				      int priority)
-{
-	g_return_val_if_fail (IS_FILE_TRANSFER_DIALOG (dlg),
-			      GNOME_VFS_ERROR_BAD_PARAMETERS);
-
-	return gnome_vfs_async_xfer (&dlg->priv->handle,
-				     source_uri_list,
-				     target_uri_list,
-				     xfer_options,
-				     error_mode,
-				     overwrite_mode,
-				     priority,
-				     file_transfer_dialog_update_cb,
-				     dlg,
-				     NULL,
-				     NULL
-				   );
+				      GFile *src_file,
+				      GFile *target_file)
+{
+	GCancellable *cancellable;
+	char *from_uri;
+	char *to_uri;
+	char *str;
+
+	g_return_if_fail (IS_FILE_TRANSFER_DIALOG (dlg));
+	g_return_if_fail (src_file != NULL && target_file != NULL);
+	cancellable = g_cancellable_new ();
+	from_uri = g_file_get_uri (src_file);
+	to_uri = g_file_get_uri (target_file);
+	dlg->priv->cancellable = cancellable;
+
+	g_object_set (G_OBJECT (dlg),
+		      "from_uri", from_uri,
+		      NULL);
+
+	g_object_set (G_OBJECT (dlg),
+		      "to_uri", to_uri,
+		      NULL);
+
+	str = g_strdup_printf ("<i>%s</i>", _("Connecting..."));
+	gtk_label_set_markup (GTK_LABEL (dlg->priv->current),
+			      str);
+	g_free (str);
+	g_free (from_uri);
+	g_free (to_uri);
+
+	g_file_copy_async (src_file, target_file,
+			   0, G_PRIORITY_DEFAULT,
+			   cancellable,
+			   (GFileProgressCallback) file_transfer_progress_cb,
+			   dlg,
+			   (GAsyncReadyCallback) file_transfer_async_ready_cb,
+			   dlg);
 }
Index: src/file-transfer-dialog.h
===================================================================
--- src/file-transfer-dialog.h	(revisione 1350)
+++ src/file-transfer-dialog.h	(copia locale)
@@ -25,7 +25,7 @@
 #define __FILE_TRANSFER_DIALOG_H__
 
 #include <gtk/gtkdialog.h>
-#include <libgnomevfs/gnome-vfs-xfer.h>
+#include <gio/gio.h>
 
 G_BEGIN_DECLS
 
@@ -55,14 +55,9 @@ struct _FileTransferDialogClass
 GType	       file_transfer_dialog_get_type (void);
 GtkWidget*     file_transfer_dialog_new (void);
 
-GnomeVFSResult file_transfer_dialog_wrap_async_xfer (FileTransferDialog *dlg,
-						     GList *source_uri_list,
-						     GList *target_uri_list,
-						     GnomeVFSXferOptions xfer_options,
-						     GnomeVFSXferErrorMode error_mode,
-						     GnomeVFSXferOverwriteMode overwrite_mode,
-						     int priority);
-
+void           file_transfer_dialog_wrap_async_xfer (FileTransferDialog *dlg,
+						     GFile *src_file,
+						     GFile *target_file);
 
 G_END_DECLS
 
Index: src/gnome-screensaver-preferences.c
===================================================================
--- src/gnome-screensaver-preferences.c	(revisione 1350)
+++ src/gnome-screensaver-preferences.c	(copia locale)
@@ -31,15 +31,12 @@
 #include <sys/types.h>		/* For uid_t, gid_t */
 
 #include <glib/gi18n.h>
+#include <gio/gio.h>
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
 #include <glade/glade.h>
 #include <gconf/gconf-client.h>
 
-#include <libgnomevfs/gnome-vfs-async-ops.h>
-#include <libgnomevfs/gnome-vfs-ops.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
-
 #include "file-transfer-dialog.h"
 
 #include "gs-theme-manager.h"
@@ -811,11 +808,9 @@ reload_themes (void)
 
 static void
 transfer_done_cb (GtkWidget *dialog,
-                  char      *path)
+                  GFile     *file)
 {
-
-        g_free (path);
-
+	g_object_unref (file);
         gtk_widget_destroy (dialog);
 
         reload_themes ();
@@ -823,51 +818,41 @@ transfer_done_cb (GtkWidget *dialog,
 
 static void
 transfer_cancel_cb (GtkWidget *dialog,
-                    char      *path)
+                    GFile     *file)
 {
-        gnome_vfs_unlink (path);
-        g_free (path);
+        g_file_delete (file, NULL, NULL);
+	g_object_unref (file);
 
         gtk_widget_destroy (dialog);
 }
 
 static void
 theme_installer_run (GtkWidget *parent,
-                     char      *filename)
+		     GFile     *src_file)
 {
         GtkWidget    *dialog;
-        GnomeVFSURI  *src_uri;
-        GList        *src;
-        GList        *target;
+	GFile        *target_file;
         char         *user_dir;
-        char         *short_name;
+        char         *truncated_name;
         char         *base_name;
-        char         *target_path;
+        char         *target_path = NULL;
         gboolean      is_desktop;
 
-        src_uri = gnome_vfs_uri_new (filename);
-        src = g_list_append (NULL, src_uri);
-        target = NULL;
-        target_path = NULL;
-
         user_dir = g_build_filename (g_get_user_data_dir (), "applications", "screensavers", NULL);
         g_mkdir_with_parents (user_dir, S_IRWXU);
 
-        short_name = gnome_vfs_uri_extract_short_name (src_uri);
-        base_name = NULL;
+        base_name = g_file_get_basename (src_file);
+        truncated_name = NULL;
 
         is_desktop = FALSE;
-        if (short_name != NULL
-            && g_str_has_suffix (short_name, ".desktop")) {
+        if (base_name != NULL
+            && g_str_has_suffix (base_name, ".desktop")) {
                 /* FIXME: validate key file? */
                 is_desktop = TRUE;
-                base_name = g_strndup (short_name, strlen (short_name) - 8);
+                truncated_name = g_strndup (base_name, strlen (base_name) - 8);
         }
 
         while (TRUE) {
-                char *tmp;
-                gboolean exists;
-
                 if (! is_desktop) {
                         dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
                                                          GTK_DIALOG_MODAL,
@@ -886,20 +871,19 @@ theme_installer_run (GtkWidget *parent,
                         goto out;
                 }
 
-                g_free (target_path);
-                target_path = g_build_filename (user_dir, short_name, NULL);
+                target_path = g_build_filename (user_dir, base_name, NULL);
+                target_file = g_file_new_for_path (target_path);
 
-                /* FIXME: racy, oh well */
-                exists = gnome_vfs_uri_exists (gnome_vfs_uri_new (target_path));
-                if (! exists) {
-                        target = g_list_append (NULL, gnome_vfs_uri_new (target_path));
-                        break;
-                }
-
-                /* try another name */
-                tmp = g_strdup_printf ("%s-%u.desktop",  base_name, g_random_int ());
-                g_free (short_name);
-                short_name = tmp;
+		if (g_file_query_exists (target_file, NULL)) {
+			/* try another name */
+			g_object_unref (target_file);
+			g_free (base_name);
+			g_free (target_path);
+        	        base_name = g_strdup_printf ("%s-%u.desktop",  truncated_name, g_random_int ());
+		} else {
+			g_free (target_path);
+			break;
+		}
         }
 
         dialog = file_transfer_dialog_new ();
@@ -907,26 +891,44 @@ theme_installer_run (GtkWidget *parent,
         gtk_window_set_icon_name (GTK_WINDOW (dialog), "screensaver");
 
         file_transfer_dialog_wrap_async_xfer (FILE_TRANSFER_DIALOG (dialog),
-                                              src, target,
-                                              GNOME_VFS_XFER_RECURSIVE,
-                                              GNOME_VFS_XFER_ERROR_MODE_QUERY,
-                                              GNOME_VFS_XFER_OVERWRITE_MODE_QUERY,
-                                              GNOME_VFS_PRIORITY_DEFAULT);
-
+                                              src_file, target_file);
         g_signal_connect (dialog, "cancel",
-                          G_CALLBACK (transfer_cancel_cb), target_path);
+                          G_CALLBACK (transfer_cancel_cb), target_file);
         g_signal_connect (dialog, "done",
-                          G_CALLBACK (transfer_done_cb), target_path);
+                          G_CALLBACK (transfer_done_cb), target_file);
 
         gtk_widget_show (dialog);
 
  out:
-        gnome_vfs_uri_list_unref (src);
-        gnome_vfs_uri_list_unref (target);
-
-        g_free (user_dir);
+	g_object_unref (src_file);
+	g_free (user_dir);
+        g_free (truncated_name);
         g_free (base_name);
-        g_free (short_name);
+}
+
+static GList*
+parse_uri_string_list_to_file_list (const gchar *uri_list)
+{
+	GList* file_list = NULL;
+	const char *start, *end;
+	char *uri;
+
+	start = uri_list;
+	end = strchr (uri_list, '\r');
+	uri = g_strndup (start, end - start);
+	file_list = g_list_append (file_list, g_file_new_for_uri (uri));
+	g_free (uri);
+
+	while (strlen (end) > 2)
+	{
+		start = (end + 2);
+		end = strchr (start, '\r');
+		uri = g_strndup (start, end - start);
+		file_list = g_list_append (file_list, g_file_new_for_uri (uri));
+		g_free (uri);
+	}
+	
+	return file_list;
 }
 
 /* Callback issued during drag movements */
@@ -963,31 +965,20 @@ drag_data_received_cb (GtkWidget        
                        gpointer          data)
 {
         GtkWidget *dialog;
-        GList     *uris;
-        char      *filename = NULL;
+	GList     *file_list;
+        GFile     *file = NULL;
 
         if (!(info == TARGET_URI_LIST || info == TARGET_NS_URL))
                 return;
 
-        uris = gnome_vfs_uri_list_parse ((char *) selection_data->data);
-        if (uris != NULL && uris->data != NULL) {
-                GnomeVFSURI *uri = (GnomeVFSURI *) uris->data;
-
-                if (gnome_vfs_uri_is_local (uri)) {
-                        filename = gnome_vfs_unescape_string (gnome_vfs_uri_get_path (uri),
-                                                              G_DIR_SEPARATOR_S);
-                } else {
-                        filename = gnome_vfs_unescape_string (gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE),
-                                                              G_DIR_SEPARATOR_S);
-                }
-
-                gnome_vfs_uri_list_unref (uris);
+        file_list = parse_uri_string_list_to_file_list ((const char *) selection_data->data);
+        if (file_list != NULL && file_list->data != NULL) {
+                file = g_object_ref (file_list->data);
+		g_list_foreach (file_list, (GFunc) g_object_unref, NULL);
+        	dialog = glade_xml_get_widget (xml, "prefs_dialog");
+		theme_installer_run (dialog, file);
+		g_list_free (file_list);
         }
-
-        dialog = glade_xml_get_widget (xml, "prefs_dialog");
-        theme_installer_run (dialog, filename);
-
-        g_free (filename);
 }
 
 /* Adapted from totem_time_to_string_text */
Index: configure.ac
===================================================================
--- configure.ac	(revisione 1350)
+++ configure.ac	(copia locale)
@@ -36,11 +36,10 @@ AM_GLIB_GNU_GETTEXT
 # Dependencies
 
 DBUS_REQUIRED_VERSION=0.30
-GLIB_REQUIRED_VERSION=2.7.0
+GLIB_REQUIRED_VERSION=2.15.0
 GCONF_REQUIRED_VERSION=2.6.1
 GDK_REQUIRED_VERSION=2.7.0
 GTK_REQUIRED_VERSION=2.11.5
-GNOME_VFS_REQUIRED_VERSION=2.14
 LIBGNOME_MENU_REQUIRED_VERSION=2.11.1
 
 GLADE_REQUIRED_VERSION=2.5.0
@@ -71,7 +70,8 @@ AC_SUBST(GNOME_SCREENSAVER_DIALOG_CFLAGS
 AC_SUBST(GNOME_SCREENSAVER_DIALOG_LIBS)
 
 PKG_CHECK_MODULES(GNOME_SCREENSAVER_CAPPLET,
-        gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED_VERSION
+        gio-2.0 >= $GLIB_REQUIRED_VERSION
+	gconf-2.0 >= $GCONF_REQUIRED_VERSION
         libglade-2.0 >= $GLADE_REQUIRED_VERSION
         gtk+-2.0 >= $GTK_REQUIRED_VERSION
         libgnome-menu >= $LIBGNOME_MENU_REQUIRED_VERSION)
