aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorRoss Burton <ross@openedhand.com>2006-07-19 15:15:31 +0800
committerRoss Burton <rburton@src.gnome.org>2006-07-19 15:15:31 +0800
commitcbf5c9c9707c2c1538d5afaa4f8060d2bdc09faa (patch)
treeed1804857fdba6eb13e7b3490412b00ccc0605ca /addressbook
parent4b5ed288c1ff22c8b6eebadf9bd52f28c27dde9f (diff)
downloadgsoc2013-evolution-cbf5c9c9707c2c1538d5afaa4f8060d2bdc09faa.tar.gz
gsoc2013-evolution-cbf5c9c9707c2c1538d5afaa4f8060d2bdc09faa.tar.zst
gsoc2013-evolution-cbf5c9c9707c2c1538d5afaa4f8060d2bdc09faa.zip
[addressbook]
2006-07-18 Ross Burton <ross@openedhand.com> * addressbook/gui/contact-editor/e-contact-editor.c: * addressbook/gui/contact-list-editor/e-contact-list-editor.c: * addressbook/gui/widgets/eab-contact-display.c: Fix for EContactPhoto changes. Partially fixed by Hiroyuki Ikezoe <poincare@ikezoe.net>, finished by myself. (#347870). [plugins/bbdb] 2006-07-18 Ross Burton <ross@openedhand.com> * gaimbuddies.c: Fix for EContactPhoto change. Partially fixed by Hiroyuki Ikezoe <poincare@ikezoe.net>, rest by me. (#347870) svn path=/trunk/; revision=32343
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog8
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c17
-rw-r--r--addressbook/gui/contact-list-editor/e-contact-list-editor.c10
-rw-r--r--addressbook/gui/widgets/eab-contact-display.c7
4 files changed, 27 insertions, 15 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 268a910ea2..6d1eb078fc 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,11 @@
+2006-07-18 Ross Burton <ross@openedhand.com>
+
+ * addressbook/gui/contact-editor/e-contact-editor.c:
+ * addressbook/gui/contact-list-editor/e-contact-list-editor.c:
+ * addressbook/gui/widgets/eab-contact-display.c:
+ Fix for EContactPhoto changes. Partially fixed by Hiroyuki Ikezoe
+ <poincare@ikezoe.net>, finished by myself. (#347870).
+
2006-07-18 Andre Klapper <a9016009@gmx.de>
* gui/contact-editor/contact-editor.glade:
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 0e0e9c0ce1..0a385da616 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -2192,10 +2192,10 @@ fill_in_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id)
}
else if (E_IS_IMAGE_CHOOSER (widget)) {
EContactPhoto *photo = e_contact_get (contact, field_id);
- if (photo) {
+ if (photo && photo->type == E_CONTACT_PHOTO_TYPE_INLINED) {
e_image_chooser_set_image_data (E_IMAGE_CHOOSER (widget),
- photo->data,
- photo->length);
+ photo->data.inlined.data,
+ photo->data.inlined.length);
editor->image_set = TRUE;
}
else {
@@ -2259,15 +2259,16 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id)
}
else if (E_IS_IMAGE_CHOOSER (widget)) {
EContactPhoto photo;
+ photo.type = E_CONTACT_PHOTO_TYPE_INLINED;
if (editor->image_changed)
{
if (editor->image_set &&
e_image_chooser_get_image_data (E_IMAGE_CHOOSER (widget),
- &photo.data, &photo.length)) {
+ &photo.data.inlined.data, &photo.data.inlined.length)) {
GdkPixbuf *pixbuf, *new;
GdkPixbufLoader *loader = gdk_pixbuf_loader_new();
- gdk_pixbuf_loader_write (loader, photo.data, photo.length, NULL);
+ gdk_pixbuf_loader_write (loader, photo.data.inlined.data, photo.data.inlined.length, NULL);
gdk_pixbuf_loader_close (loader, NULL);
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
@@ -2291,8 +2292,8 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id)
new = gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
if (new) {
- g_free(photo.data);
- gdk_pixbuf_save_to_buffer (new, &photo.data, &photo.length, "jpeg", NULL, "quality", "100", NULL);
+ g_free(photo.data.inlined.data);
+ gdk_pixbuf_save_to_buffer (new, &photo.data.inlined.data, &photo.data.inlined.length, "jpeg", NULL, "quality", "100", NULL);
g_object_unref (new);
}
@@ -2305,7 +2306,7 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id)
e_contact_set (contact, field_id, &photo);
- g_free (photo.data);
+ g_free (photo.data.inlined.data);
}
else {
diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index 5674ffb7db..9b0f6043bb 100644
--- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -1088,8 +1088,10 @@ extract_info(EContactListEditor *editor)
&image_data_len)) {
EContactPhoto photo;
- photo.data = image_data;
- photo.length = image_data_len;
+ photo.type = E_CONTACT_PHOTO_TYPE_INLINED;
+ photo.data.inlined.mime_type = NULL;
+ photo.data.inlined.data = image_data;
+ photo.data.inlined.length = image_data_len;
e_contact_set (contact, E_CONTACT_LOGO, &photo);
g_free (image_data);
@@ -1177,8 +1179,8 @@ fill_in_info(EContactListEditor *editor)
g_list_free (email_list);
photo = e_contact_get (editor->contact, E_CONTACT_LOGO);
- if (photo) {
- e_image_chooser_set_image_data (E_IMAGE_CHOOSER (editor->list_image), photo->data, photo->length);
+ if (photo && photo->type == E_CONTACT_PHOTO_TYPE_INLINED) {
+ e_image_chooser_set_image_data (E_IMAGE_CHOOSER (editor->list_image), photo->data.inlined.data, photo->data.inlined.length);
e_contact_photo_free (photo);
}
}
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c
index 082b537e2e..0ce9f346d3 100644
--- a/addressbook/gui/widgets/eab-contact-display.c
+++ b/addressbook/gui/widgets/eab-contact-display.c
@@ -227,7 +227,7 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
if (!photo)
photo = e_contact_get (display->priv->contact, E_CONTACT_LOGO);
- gtk_html_stream_write (handle, photo->data, photo->length);
+ gtk_html_stream_write (handle, photo->data.inlined.data, photo->data.inlined.length);
gtk_html_end (html, handle, GTK_HTML_STREAM_OK);
@@ -575,7 +575,8 @@ eab_contact_display_render_normal (EABContactDisplay *display, EContact *contact
photo = e_contact_get (contact, E_CONTACT_PHOTO);
if (!photo)
photo = e_contact_get (contact, E_CONTACT_LOGO);
- if (photo) {
+ /* Only handle inlined photos for now */
+ if (photo && photo->type == E_CONTACT_PHOTO_TYPE_INLINED) {
gtk_html_stream_printf (html_stream, "<img border=\"1\" src=\"internal-contact-photo:\">");
e_contact_photo_free (photo);
}
@@ -645,7 +646,7 @@ eab_contact_display_render_compact (EABContactDisplay *display, EContact *contac
image here. we don't scale the pixbuf
itself, just insert width/height tags in
the html */
- gdk_pixbuf_loader_write (loader, photo->data, photo->length, NULL);
+ gdk_pixbuf_loader_write (loader, photo->data.inlined.data, photo->data.inlined.length, NULL);
gdk_pixbuf_loader_close (loader, NULL);
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
if (pixbuf)