2007-10-09 [colin] 3.0.2cvs45
authorColin Leroy <colin@colino.net>
Tue, 9 Oct 2007 16:47:16 +0000 (16:47 +0000)
committerColin Leroy <colin@colino.net>
Tue, 9 Oct 2007 16:47:16 +0000 (16:47 +0000)
* src/editaddress.c
* src/headerview.c
* src/textview.c
Add error handling

ChangeLog
PATCHSETS
configure.ac
src/editaddress.c
src/headerview.c
src/textview.c

index b9ef36a3bd60bfe09c67345b2dc1fc363832371d..1ffb68a3acb323f9a078e396a5f981ab1142aaa4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-09 [colin]     3.0.2cvs45
+
+       * src/editaddress.c
+       * src/headerview.c
+       * src/textview.c
+               Add error handling
+
 2007-10-09 [colin]     3.0.2cvs44
 
        * src/addrduplicates.c
index 901c0239c933b12785f468dd3ab55dc729a3dce9..fac83c7fe95fd3f4136d004085f5f5965faf36eb 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.30.2.44 -r 1.30.2.45 src/prefs_toolbar.c;  ) > 3.0.2cvs42.patchset
 ( cvs diff -u -r 1.4.2.52 -r 1.4.2.53 src/gtk/about.c;  ) > 3.0.2cvs43.patchset
 ( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/addrduplicates.c;  cvs diff -u -r 1.9.2.16 -r 1.9.2.17 src/addressadd.c;  cvs diff -u -r 1.2.16.5 -r 1.2.16.6 src/addressadd.h;  cvs diff -u -r 1.60.2.101 -r 1.60.2.102 src/addressbook.c;  cvs diff -u -r 1.18.2.10 -r 1.18.2.11 src/addressbook.h;  cvs diff -u -r 1.28.2.33 -r 1.28.2.34 src/addrindex.c;  cvs diff -u -r 1.9.2.13 -r 1.9.2.14 src/addrindex.h;  cvs diff -u -r 1.13.2.14 -r 1.13.2.15 src/addritem.c;  cvs diff -u -r 1.12.2.12 -r 1.12.2.13 src/addritem.h;  cvs diff -u -r 1.382.2.414 -r 1.382.2.415 src/compose.c;  cvs diff -u -r 1.14.2.30 -r 1.14.2.31 src/editaddress.c;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/editaddress_other_attributes_ldap.h;  cvs diff -u -r 1.8.2.22 -r 1.8.2.23 src/headerview.c;  cvs diff -u -r 1.94.2.155 -r 1.94.2.156 src/messageview.c;  cvs diff -u -r 1.83.2.118 -r 1.83.2.119 src/mimeview.c;  cvs diff -u -r 1.395.2.327 -r 1.395.2.328 src/summaryview.c;  cvs diff -u -r 1.96.2.182 -r 1.96.2.183 src/textview.c;  cvs diff -u -r 1.5.2.66 -r 1.5.2.67 src/gtk/gtkutils.c;  ) > 3.0.2cvs44.patchset
+( cvs diff -u -r 1.14.2.31 -r 1.14.2.32 src/editaddress.c;  cvs diff -u -r 1.8.2.23 -r 1.8.2.24 src/headerview.c;  cvs diff -u -r 1.96.2.183 -r 1.96.2.184 src/textview.c;  ) > 3.0.2cvs45.patchset
index fddc6793174baf8d4f8ed41baec8751512454d8c..9f70b04191a0b800f7e499ab96c4520ca285706a 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=44
+EXTRA_VERSION=45
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index b182b181620b6cfdd923e1a3ecec0af5fd2dd78c..976cb4b6136b252c9689c1e33881585d391cde66 100644 (file)
@@ -33,6 +33,7 @@
 #include <gtk/gtkentry.h>
 #include <gtk/gtktable.h>
 
+#include "alertpanel.h"
 #include "mgutils.h"
 #include "addressbook.h"
 #include "addressitem.h"
@@ -720,6 +721,11 @@ static void addressbook_edit_person_set_picture(GtkWidget *widget,
        if (event->button == 1) {
                if ( (filename = filesel_select_file_open(_("Choose a picture"), NULL)) ) {
                        personeditdlg.pixbuf = gdk_pixbuf_new_from_file(filename, &error);
+                       if (error) {
+                               alertpanel_error(_("Failed to import image: \n%s"),
+                                               error->message);
+                               g_error_free(error);
+                       }
                        personeditdlg.picture_set = TRUE;
                        g_free(filename);
                        width = gdk_pixbuf_get_width(personeditdlg.pixbuf);
@@ -1526,14 +1532,19 @@ ItemPerson *addressbook_edit_person( AddressBookFile *abf, ItemFolder *parent_fo
                                                        current_person->picture, NULL );
                        if (is_file_exist(filename)) {
                                personeditdlg.pixbuf = gdk_pixbuf_new_from_file(filename, &error);
+                               if (error) {
+                                       debug_print("Failed to import image: \n%s",
+                                                       error->message);
+                                       g_error_free(error);
+                                       goto no_img;
+                               }
                                personeditdlg.picture_set = TRUE;
                        } else {
-                               personeditdlg.picture_set = FALSE;
-                               personeditdlg.pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 48, 48);
-                               gdk_pixbuf_fill(personeditdlg.pixbuf, 0xffffff00);
+                               goto no_img;
                        }
                        g_free(filename);
                } else {
+no_img:
                        personeditdlg.picture_set = FALSE;
                        personeditdlg.pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, 48, 48);
                        gdk_pixbuf_fill(personeditdlg.pixbuf, 0xffffff00);
index 38148c2cec3e89f565d76f060200c702812b27ed..4d8e2a1d36fdcb721b0d25bcdf9e03278859680b 100644 (file)
@@ -381,6 +381,12 @@ static gint headerview_show_contact_pic (HeaderView *headerview, MsgInfo *msginf
                picture = gdk_pixbuf_new_from_file(filename, &error);
 
        g_free(filename);
+       if (error) {
+               debug_print("Failed to import image: \n%s",
+                               error->message);
+               g_error_free(error);
+               return -1;
+       }
        if (picture)
                image = gtk_image_new_from_pixbuf(picture);
        else 
index 9f9d09dea6266b5eedbfd7514d9e14c070d57fd3..a4871fa05cbf9433b38645088c75903312fb9f71 100644 (file)
@@ -1963,6 +1963,12 @@ static void textview_show_contact_pic(TextView *textview)
        else
                picture = gdk_pixbuf_new_from_file(filename, &error);
 
+       if (error) {
+               debug_print("Failed to import image: \n%s",
+                               error->message);
+               g_error_free(error);
+               goto bail;
+       }
        g_free(filename);
 
        if (picture)