aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2004-05-29 12:48:18 +0800
committerChris Toshok <toshok@src.gnome.org>2004-05-29 12:48:18 +0800
commit5a4b4234c4b4bb033ed60e75ceeb1343fc89524c (patch)
treec3478aeac44e6d07072defd3694263fbb53d8f0d
parent3feccd8c20fdd464521369678195af32ac067125 (diff)
downloadgsoc2013-evolution-5a4b4234c4b4bb033ed60e75ceeb1343fc89524c.tar
gsoc2013-evolution-5a4b4234c4b4bb033ed60e75ceeb1343fc89524c.tar.gz
gsoc2013-evolution-5a4b4234c4b4bb033ed60e75ceeb1343fc89524c.tar.bz2
gsoc2013-evolution-5a4b4234c4b4bb033ed60e75ceeb1343fc89524c.tar.lz
gsoc2013-evolution-5a4b4234c4b4bb033ed60e75ceeb1343fc89524c.tar.xz
gsoc2013-evolution-5a4b4234c4b4bb033ed60e75ceeb1343fc89524c.tar.zst
gsoc2013-evolution-5a4b4234c4b4bb033ed60e75ceeb1343fc89524c.zip
render all email addresses, not just the first 3.
2004-05-28 Chris Toshok <toshok@ximian.com> * 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
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/gui/widgets/eab-contact-display.c44
2 files changed, 24 insertions, 26 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index e184545e0f..57af8d0338 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,11 @@
2004-05-28 Chris Toshok <toshok@ximian.com>
+ * 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++.
+
+2004-05-28 Chris Toshok <toshok@ximian.com>
+
* gui/component/select-names/e-select-names-bonobo.c
(entry_set_property_fn): call e_select_names_model_load_contacts
after setting text/addresses/destinations.
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 <gtkhtml/gtkhtml-stream.h>
#include <gtk/gtkscrolledwindow.h>
+/*#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, "<table border=\"0\">");
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, "<a href=\"internal-mailto:0\">%s</a>", e);
- nl = "<br>";
-#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, "<a href=\"internal-mailto:1\">%s</a>", e);
- nl = "<br>";
-#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, "<a href=\"internal-mailto:2\">%s</a>", e);
+ char *html = e_text_to_html (l->data, 0);
+ g_string_append_printf (accum, "%s<a href=\"internal-mailto:%d\">%s</a>", nl, email_num, html);
+ email_num ++;
+ g_free (html);
nl = "<br>";
+
#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