aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/gui/widgets/e-minicard.c27
2 files changed, 33 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index af0c97460d..ef25e97f7a 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,11 @@
2003-01-23 Sean Gao <Sean.Gao@Sun.COM>
+ [ fixes bug #34898 ]
+ * gui/widgets/e-minicard.c (field_changed): handle modifications
+ to email addresses in contact lists.
+
+2003-01-23 Sean Gao <Sean.Gao@Sun.COM>
+
[ fixes bug #36375 ]
* backend/pas/pas-backend-ldap.c: use PHONE_OTHER_FAX instead of
PHONE_OTHER for "other_fax".
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 4fa9ace991..dc679aad55 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -732,6 +732,8 @@ field_changed (EText *text, EMinicard *e_minicard)
{
ECardSimpleType type;
char *string;
+ char *new_string;
+ gboolean is_list = FALSE;
type = GPOINTER_TO_INT
(g_object_get_data(G_OBJECT(text),
@@ -739,6 +741,31 @@ field_changed (EText *text, EMinicard *e_minicard)
g_object_get(text,
"text", &string,
NULL);
+
+ /*
+ * If the card is coresponding with a contact list and the field be
+ * changed is e-mail address, should wrap it before write it back.
+ */
+ new_string = (char*)e_card_simple_get_const (e_minicard->simple,
+ E_CARD_SIMPLE_FIELD_IS_LIST);
+
+ is_list = (NULL != new_string);
+
+ if (is_list && (E_CARD_SIMPLE_FIELD_EMAIL == type ||
+ E_CARD_SIMPLE_FIELD_EMAIL_2 == type ||
+ E_CARD_SIMPLE_FIELD_EMAIL_3 == type)) {
+ if (string && *string) {
+ EDestination *dest = e_destination_new ();
+ if (dest != NULL){
+ e_destination_set_email (dest, string);
+ new_string = e_destination_export(dest);
+ g_free(string);
+ string=new_string;
+ gtk_object_unref (GTK_OBJECT (dest));
+ }
+ }
+ }
+
e_card_simple_set(e_minicard->simple,
type,
string);