[gthumb] overwrite dialog: do not show an error after cancelling the operation
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] overwrite dialog: do not show an error after cancelling the operation
- Date: Tue, 5 Nov 2019 10:40:45 +0000 (UTC)
commit ccfcfdd05fd065498bc221a9144374bfb93b2108
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Nov 5 10:36:19 2019 +0100
overwrite dialog: do not show an error after cancelling the operation
The ignored error is GTH_TASK_ERROR_CANCELLED not G_IO_ERROR_CANCELLED.
extensions/file_manager/gth-copy-task.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/extensions/file_manager/gth-copy-task.c b/extensions/file_manager/gth-copy-task.c
index 67aa2bb9..36803ef7 100644
--- a/extensions/file_manager/gth-copy-task.c
+++ b/extensions/file_manager/gth-copy-task.c
@@ -60,10 +60,14 @@ copy_done_cb (GObject *object,
{
/* 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;
+ * error dialog for this type of errors. To do this create a
+ * GTH_TASK_ERROR_CANCELLED error, which is always ignored by
+ * GthBrowser. */
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS)
+ || g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ {
+ error = g_error_new_literal (GTH_TASK_ERROR, GTH_TASK_ERROR_CANCELLED, "");
+ }
gth_task_completed (GTH_TASK (user_data), error);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]