From 5a4b4234c4b4bb033ed60e75ceeb1343fc89524c Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sat, 29 May 2004 04:48:18 +0000 Subject: render all email addresses, not just the first 3. 2004-05-28 Chris Toshok * gui/widgets/eab-contact-display.c (render_contact): render all email addresses, not just the first 3. (eab_contact_display_class_init): use a C comment, not C++. svn path=/trunk/; revision=26130 --- addressbook/gui/widgets/eab-contact-display.c | 44 +++++++++++---------------- 1 file changed, 18 insertions(+), 26 deletions(-) (limited to 'addressbook/gui/widgets') diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index a74fc3a7cb..bffc0b1166 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -33,6 +33,8 @@ #include #include +/*#define HANDLE_MAILTO_INTERNALLY 1*/ + #define PARENT_TYPE (gtk_vbox_get_type ()) struct _EABContactDisplayPrivate { @@ -281,43 +283,33 @@ static void render_contact (GtkHTMLStream *html_stream, EContact *contact) { GString *accum; - const char *e; + GList *email_list, *l; +#ifdef HANDLE_MAILTO_INTERNALLY + int email_num = 0; +#endif char *nl; gtk_html_stream_printf (html_stream, ""); accum = g_string_new (""); nl = ""; - e = e_contact_get_const (contact, E_CONTACT_EMAIL_1); - if (e) { -#ifdef HANDLE_MAILTO_INTERNALLY - g_string_append_printf (accum, "%s", e); - nl = "
"; -#else - g_string_append_printf (accum, "%s", e); - nl = "\n"; -#endif - } - e = e_contact_get_const (contact, E_CONTACT_EMAIL_2); - if (e) { -#ifdef HANDLE_MAILTO_INTERNALLY - g_string_append_printf (accum, "%s", e); - nl = "
"; -#else - g_string_append_printf (accum, "%s%s", nl, e); - nl = "\n"; -#endif - } - e = e_contact_get_const (contact, E_CONTACT_EMAIL_3); - if (e) { + + email_list = e_contact_get (contact, E_CONTACT_EMAIL); + for (l = email_list; l; l = l->next) { #ifdef HANDLE_MAILTO_INTERNALLY - g_string_append_printf (accum, "%s", e); + char *html = e_text_to_html (l->data, 0); + g_string_append_printf (accum, "%s%s", nl, email_num, html); + email_num ++; + g_free (html); nl = "
"; + #else - g_string_append_printf (accum, "%s%s", nl, e); + g_string_append_printf (accum, "%s%s", nl, l->data); nl = "\n"; #endif } + g_list_foreach (email_list, (GFunc)g_free, NULL); + g_list_free (email_list); if (accum->len) { start_block (html_stream, ""); @@ -670,7 +662,7 @@ eab_contact_display_init (GObject *object) static void eab_contact_display_class_init (GtkObjectClass *object_class) { - // object_class->destroy = mail_display_destroy; + /* object_class->destroy = mail_display_destroy;*/ } GType -- cgit v1.2.3