[gthumb] ignore errors due to the user choosing to not overwrite files.



commit 458258f945c317a44b6cac952a46026169b1f273
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Feb 20 13:35:29 2011 +0100

    ignore errors due to the user choosing to not overwrite files.

 extensions/file_manager/gth-copy-task.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/extensions/file_manager/gth-copy-task.c b/extensions/file_manager/gth-copy-task.c
index 0714ffb..f8406aa 100644
--- a/extensions/file_manager/gth-copy-task.c
+++ b/extensions/file_manager/gth-copy-task.c
@@ -54,6 +54,12 @@ copy_done_cb (GObject    *object,
 	      GError     *error,
 	      gpointer    user_data)
 {
+	/* Errors with code G_IO_ERROR_EXISTS are generated when the user
+	 * chooses to not overwrite the files.  There is no need to show an
+	 * error dialog for this type of errors.  To do this the code is set to
+	 * G_IO_ERROR_CANCELLED, which is always ignored by GthBrowser. */
+	if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS))
+		error->code = G_IO_ERROR_CANCELLED;
 	gth_task_completed (GTH_TASK (user_data), error);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]