evolution-exchange r1579 - in trunk: . addressbook



Author: mcrha
Date: Fri Feb 22 18:49:41 2008
New Revision: 1579
URL: http://svn.gnome.org/viewvc/evolution-exchange?rev=1579&view=rev

Log:
2008-02-22  Milan Crha  <mcrha redhat com>

	** Part of fix for bug #514836

	* addressbook/e-book-backend-gal.c: (member_populate):
	Obsoleting EVC_X_DEST_EMAIL and EVC_X_DEST_NAME and one leak fix.



Modified:
   trunk/ChangeLog
   trunk/addressbook/e-book-backend-gal.c

Modified: trunk/addressbook/e-book-backend-gal.c
==============================================================================
--- trunk/addressbook/e-book-backend-gal.c	(original)
+++ trunk/addressbook/e-book-backend-gal.c	Fri Feb 22 18:49:41 2008
@@ -1251,12 +1251,25 @@
 
 		member_info = g_strsplit (values [i], ";", -1);
 		attr = e_vcard_attribute_new (NULL, EVC_EMAIL);
-		e_vcard_attribute_add_param_with_value (attr, e_vcard_attribute_param_new (EVC_X_DEST_EMAIL), member_info [0]);
 		e_vcard_attribute_add_param_with_value (attr, e_vcard_attribute_param_new (EVC_X_DEST_CONTACT_UID), member_info [1]);
-		if (member_info [2])
-			e_vcard_attribute_add_param_with_value (attr, e_vcard_attribute_param_new (EVC_X_DEST_NAME), member_info [2]);
-		e_vcard_attribute_add_value (attr, member_info [0]);
+
+		if (member_info [2]) {
+			int len = strlen (member_info [2]);
+			char *value;
+
+			if (member_info [2][0] == '\"' && member_info [2][len - 1] == '\"')
+				value = g_strdup_printf ("%s %s", member_info [2], member_info [0]);
+			else
+				value = g_strdup_printf ("\"%s\" %s", member_info [2], member_info [0]);
+
+			e_vcard_attribute_add_value (attr, value);
+			g_free (value);
+		} else {
+			e_vcard_attribute_add_value (attr, member_info [0]);
+		}
+
 		e_vcard_add_attribute (E_VCARD (contact), attr);
+		g_strfreev (member_info);
 	}
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]