Commit ccfcfdd0 authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

overwrite dialog: do not show an error after cancelling the operation

The ignored error is GTH_TASK_ERROR_CANCELLED not G_IO_ERROR_CANCELLED.
parent fe504d17
...@@ -60,10 +60,14 @@ copy_done_cb (GObject *object, ...@@ -60,10 +60,14 @@ copy_done_cb (GObject *object,
{ {
/* Errors with code G_IO_ERROR_EXISTS are generated when the user /* 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 * 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 * error dialog for this type of errors. To do this create a
* G_IO_ERROR_CANCELLED, which is always ignored by GthBrowser. */ * GTH_TASK_ERROR_CANCELLED error, which is always ignored by
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS)) * GthBrowser. */
error->code = G_IO_ERROR_CANCELLED; 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); gth_task_completed (GTH_TASK (user_data), error);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment