[gnome-control-center] background: Handle copy cancellation correctly



commit e06657e7da4dd849bb8e8fdb0c482184b392a534
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 19a245e..02c51b0 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -494,9 +494,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]