[gnome-control-center/gnome-3-6] background: Handle copy cancellation correctly
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gnome-3-6] background: Handle copy cancellation correctly
- Date: Wed, 17 Oct 2012 09:37:06 +0000 (UTC)
commit 38b7e045f1d439ea81429d5b414008960575c62b
Author: Bastien Nocera <hadess hadess net>
Date: Wed Oct 17 09:37:10 2012 +0200
background: Handle copy cancellation correctly
Make sure to avoid poking at the panel when the file copy
is cancelled.
panels/background/cc-background-panel.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index 9dade8b..f57ac62 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -455,9 +455,11 @@ copy_finished_cb (GObject *source_object,
if (!g_file_copy_finish (G_FILE (source_object), result, &err))
{
- if (err->code != G_IO_ERROR_CANCELLED)
- g_warning ("Failed to copy image to cache location: %s", err->message);
-
+ if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_error_free (err);
+ return;
+ }
+ g_warning ("Failed to copy image to cache location: %s", err->message);
g_error_free (err);
}
item = g_object_get_data (source_object, "item");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]