Index: src/dlg-file-utils.c
===================================================================
--- src/dlg-file-utils.c	(revisão 2394)
+++ src/dlg-file-utils.c	(cópia de trabalho)
@@ -35,6 +35,7 @@
 #include "comments.h"
 #include "dlg-file-utils.h"
 #include "file-utils.h"
+#include "gfile-utils.h"
 #include "glib-utils.h"
 #include "image-viewer.h"
 #include "main.h"
@@ -1078,7 +1079,8 @@
 	GtkWidget           *progress_cancel;
 
 	guint                timeout_id;
-
+	
+	GError              *error;
 	GnomeVFSAsyncHandle *handle;
 	GnomeVFSResult       result;
 	OverwriteResult      overwrite_result;
@@ -1215,7 +1217,64 @@
 	gtk_widget_show (d);
 }
 
+static void
+continue_or_abort_dialog_gio (FileCopyData   *fcdata,
+			      GError         *error)
+{
+	GtkWidget  *d;
+	const char *src_file;
+	const char *error_desc;
+	char       *message;
+	char       *utf8_name;
+	gboolean    last_file;
 
+	g_clear_error (&fcdata->error);
+	g_propagate_error (&fcdata->error, error);
+	src_file = fcdata->current_file->data;
+
+	if (fcdata->remove_source)
+		error_desc = _("Could not move the image:");
+	else
+		error_desc = _("Could not copy the image:");
+	utf8_name = basename_for_display (src_file);
+	message = g_strconcat (error_desc,
+			       " ",
+			       utf8_name,
+			       "\n\n",
+			       error->message,
+			       NULL);
+	g_free (utf8_name);
+
+	last_file = fcdata->current_file->next == NULL;
+
+	if (last_file)
+		d = _gtk_message_dialog_new (GTK_WINDOW (fcdata->window),
+					     GTK_DIALOG_MODAL,
+					     GTK_STOCK_DIALOG_ERROR,
+					     message,
+					     NULL,
+					     GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL,
+					     NULL);
+	else
+		d = _gtk_yesno_dialog_new (GTK_WINDOW (fcdata->window),
+					   GTK_DIALOG_MODAL,
+					   message,
+					   _("_Abort"),
+					   _("_Continue"));
+
+	g_free (message);
+
+	g_signal_connect (G_OBJECT (d),
+			  "response",
+			  G_CALLBACK (file_copy__continue_or_abort__response_cb),
+			  fcdata);
+
+	fcdata->continue_dialog_visible = TRUE;
+
+	gtk_widget_hide (fcdata->progress_dialog);
+	gtk_widget_show (d);
+}
+
 static void
 files_copy__done (FileCopyData *fcdata)
 {
@@ -1264,55 +1323,64 @@
 	return TRUE;
 }
 
+static void
+file_progress_update_cb_gio (GFile *source,
+			     GFile *destination,
+			     GError *error,
+			     AsyncXferData *data,
+			     gpointer user_data)
+{
+	FileCopyData *fcdata = user_data;
 
+	if (!error) {
+		if (! fcdata->copying_cache) { /* do not notify cache data. */
+				char *src_file;
+				char *dest_file;
+				
+				src_file = fcdata->current_file->data;
+				dest_file = gfile_get_uri (destination);
+				fcdata->copied_list = g_list_prepend (fcdata->copied_list, src_file);
+				fcdata->created_list = g_list_prepend (fcdata->created_list, dest_file);
+				copy_next_file (fcdata);
+		} else
+			files_copy__done (fcdata);
+	} else
+		continue_or_abort_dialog_gio (fcdata, error);
+}
+
 static void
 xfer_file (FileCopyData *fcdata,
 	   const char   *src_file,
 	   const char   *dest_file)
 {
-	GnomeVFSURI               *src_uri, *dest_uri;
-	GList                     *src_list, *dest_list;
-	GnomeVFSXferOptions        xfer_options;
-	GnomeVFSXferErrorMode      xfer_error_mode;
-	GnomeVFSXferOverwriteMode  overwrite_mode;
-	GnomeVFSResult             result;
+	GList *src_list, *dest_list;
 
-	src_uri = new_uri_from_path (src_file);
-	src_list = g_list_append (NULL, src_uri);
+	src_list = g_list_append (NULL, gfile_new(src_file));
+	dest_list = g_list_append (NULL, gfile_new(dest_file));
 
-	dest_uri = new_uri_from_path (dest_file);
-	dest_list = g_list_append (NULL, dest_uri);
-
-	xfer_options    = fcdata->remove_source ? GNOME_VFS_XFER_REMOVESOURCE : 0;
-	xfer_error_mode = GNOME_VFS_XFER_ERROR_MODE_QUERY;
-	overwrite_mode  = GNOME_VFS_XFER_OVERWRITE_MODE_REPLACE;
-
 	/* Delete thumbnail from cache, if source file is removed */
 	if (fcdata->remove_source)
 		delete_thumbnail (src_file);
 
-	result = gnome_vfs_async_xfer (&fcdata->handle,
-				       src_list,
-				       dest_list,
-				       xfer_options,
-				       xfer_error_mode,
-				       overwrite_mode,
-				       GNOME_VFS_PRIORITY_DEFAULT,
-				       file_progress_update_cb,
-				       fcdata,
-				       NULL,
-				       NULL);
+	async_xfer_file_gio (src_list,
+			     dest_list,
+			     fcdata->remove_source,
+			     G_FILE_COPY_OVERWRITE, 
+			     NULL, //cancel
+			     NULL, //progress
+			     NULL, //progress data
+			     NULL, //progress destroy notify
+			     file_progress_update_cb_gio, //each file callback
+			     fcdata, //each file data
+			     G_PRIORITY_DEFAULT,
+			     NULL, //done func
+			     NULL, //done data
+			     NULL); // done data free
 
-	gnome_vfs_uri_unref (src_uri);
+	g_list_foreach (src_list, (GFunc) g_object_unref, NULL);
 	g_list_free (src_list);
-
-	gnome_vfs_uri_unref (dest_uri);
+	g_list_foreach (dest_list, (GFunc) g_object_unref, NULL);
 	g_list_free (dest_list);
-
-	/**/
-
-	if (result != GNOME_VFS_OK)
-		continue_or_abort_dialog (fcdata, result);
 }
 
 
@@ -1615,7 +1683,7 @@
 		fcdata->overwrite_result = OVERWRITE_RESULT_NO;
 	fcdata->cache_copied = FALSE;
 	fcdata->copying_cache = FALSE;
-
+	fcdata->error = NULL;
 	fcdata->file_index = 1;
 	fcdata->files_total = g_list_length (file_list);
 	fcdata->continue_dialog_visible = FALSE;
