[glide] Some warnings when we fail to copy an image to clipboard
- From: Robert Carr <racarr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glide] Some warnings when we fail to copy an image to clipboard
- Date: Fri, 30 Apr 2010 19:38:26 +0000 (UTC)
commit a79db2810d9a63d55eb83688757f50f49c6051d5
Author: Robert Carr <racarr Valentine localdomain>
Date: Thu Apr 29 07:54:31 2010 -0400
Some warnings when we fail to copy an image to clipboard
src/glide-window.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/glide-window.c b/src/glide-window.c
index 9afeebb..b13ec89 100644
--- a/src/glide-window.c
+++ b/src/glide-window.c
@@ -1062,10 +1062,19 @@ glide_window_copy_action_activate (GtkAction *a,
else if (GLIDE_IS_IMAGE (selection))
{
GdkPixbuf *pbuf;
+ GError *e = NULL;
+ // TODO: Use resource path
const gchar *filename = glide_image_get_filename (GLIDE_IMAGE (selection));
// TODO: Error checking
- pbuf = gdk_pixbuf_new_from_file (filename, NULL);
+ pbuf = gdk_pixbuf_new_from_file (filename, &e);
+ if (e)
+ {
+ g_warning ("Failed to copy image to clipboard: %s", e->message);
+ g_error_free (e);
+
+ return;
+ }
gtk_clipboard_set_image (clipboard, pbuf);
g_object_unref (G_OBJECT (pbuf));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]