aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-minicard.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-01-21 18:21:29 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-01-21 18:21:29 +0800
commit2be6b60d8311b0fd537a2889f8997d3f084755b0 (patch)
tree3d867d516d19fcb3240c08d6beb3343e5110949d /addressbook/gui/widgets/e-minicard.c
parenta63fbb553de7beeec54b6d691e80f650b3548e91 (diff)
downloadgsoc2013-evolution-2be6b60d8311b0fd537a2889f8997d3f084755b0.tar
gsoc2013-evolution-2be6b60d8311b0fd537a2889f8997d3f084755b0.tar.gz
gsoc2013-evolution-2be6b60d8311b0fd537a2889f8997d3f084755b0.tar.bz2
gsoc2013-evolution-2be6b60d8311b0fd537a2889f8997d3f084755b0.tar.lz
gsoc2013-evolution-2be6b60d8311b0fd537a2889f8997d3f084755b0.tar.xz
gsoc2013-evolution-2be6b60d8311b0fd537a2889f8997d3f084755b0.tar.zst
gsoc2013-evolution-2be6b60d8311b0fd537a2889f8997d3f084755b0.zip
** Fix for bug #324604 inspired by patch of makuchaku (Mayank)
2008-01-21 Milan Crha <mcrha@redhat.com> ** Fix for bug #324604 inspired by patch of makuchaku (Mayank) * gui/widgets/eab-gui-util.h: * gui/widgets/eab-gui-util.c: (eab_parse_qp_email), (eab_parse_qp_email_to_html): New helper functions for decoding email addresses from RFC822 or RFC2047 form to UTF-8. * gui/widgets/e-minicard.c: (add_email_field): * gui/widgets/eab-contact-display.c: (render_contact_list), (render_contact), (eab_contact_display_render_compact): * gui/widgets/e-addressbook-table-adapter.c: (struct _EAddressbookTableAdapterPrivate), (addressbook_dispose), (addressbook_value_at), (addressbook_set_value_at), (remove_contacts), (modify_contact), (model_changed), (eab_table_adapter_construct): * gui/widgets/eab-gui-util.c: (get_email), (eab_send_contact_list_as_attachment): Ensure the print of the email is transformed from RFC822 or RFC2047. svn path=/trunk/; revision=34863
Diffstat (limited to 'addressbook/gui/widgets/e-minicard.c')
-rw-r--r--addressbook/gui/widgets/e-minicard.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index c0fd0b5994..02119d1c7e 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -839,7 +839,6 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, i
GnomeCanvasGroup *group;
EMinicardField *minicard_field;
char *name;
- char *string;
GList *l, *le;
int count =0;
GList *emails = e_contact_get (e_minicard->contact, E_CONTACT_EMAIL);
@@ -847,20 +846,32 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, i
for (l=email_list, le=emails; l!=NULL && count < limit && le!=NULL; l = l->next, le=le->next) {
const gchar *tmp;
+ char *email = NULL;
+ char *string = NULL;
+ char *full_string = NULL;
+ gboolean parser_check;
tmp = get_email_location ((EVCardAttribute *) l->data);
if (tmp)
name = g_strdup_printf ("%s:", tmp);
else
name = g_strdup ("");
- string = e_text_to_html (le->data, 0);
+
+ parser_check = eab_parse_qp_email ((const gchar *) le->data, &string, &email);
+ if (parser_check) {
+ /* if true, we had a quoted printable mail address */
+ full_string = g_strdup_printf ("%s <%s>", string, email);
+ } else {
+ /* we got a NON-quoted printable string */
+ string = g_strdup (le->data);
+ }
new_item = e_minicard_label_new(group);
gnome_canvas_item_set( new_item,
"width", e_minicard->width - 4.0,
"fieldname", name,
- "field", string,
+ "field", parser_check ? full_string : string,
"max_field_name_length", left_width,
"editable", FALSE /* e_minicard->editable */,
NULL );
@@ -882,8 +893,10 @@ add_email_field (EMinicard *e_minicard, GList *email_list, gdouble left_width, i
e_minicard->fields = g_list_append( e_minicard->fields, minicard_field);
e_canvas_item_move_absolute(new_item, 2, e_minicard->height);
count++;
- g_free(name);
- g_free(string);
+ g_free (name);
+ g_free (string);
+ g_free (full_string);
+ g_free (email);
}
g_list_foreach (emails, (GFunc) g_free, NULL);
g_list_free (emails);