[evolution-patches] patch for #70908 (address book)



This is a problem happens when a vcard has grouped attributes, for
exmple like
personal.EMAIL;TYPE=HOME;X-EVOLUTION-UI-SLOT=1:snallagatla novell com
personal.TEL;TYPE=HOME;TYPE=VOICE;X-EVOLUTION-UI-SLOT=2:12345

We don't support grouping but we retain them when a vcard with that is
imported. e_vcard_remove_attributes does not remove an attribute when
passed in group name is NULL, but the attribute has a group name. When
we remove value of a multi attribute field  we always want to remove all
the attributes irrespective of group name they have. So i changed the
behaviour of the function as explained in code comment.

Siva


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/ChangeLog,v
retrieving revision 1.250
diff -u -r1.250 ChangeLog
--- ChangeLog	17 Feb 2005 10:16:34 -0000	1.250
+++ ChangeLog	20 Feb 2005 18:26:34 -0000
@@ -1,3 +1,12 @@
+2005-02-19 Sivaiah Nallagatla <snallagatla novell com>
+
+	* libebook/e-vcard.c (e_vcard_remove_attributes) :
+	When passed in group is NULL, remove all the attributes
+	with name as passed in attribute name even when a attribute
+	has group name.
+
+	Fixes #70908 
+
 2005-02-17  Chenthill Palanisamy  <pchenthill novell com>
 
 	* backends/groupwise/e-book-backend-groupwise.c:
Index: libebook/e-vcard.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libebook/e-vcard.c,v
retrieving revision 1.18
diff -u -r1.18 e-vcard.c
--- libebook/e-vcard.c	14 Feb 2005 19:24:41 -0000	1.18
+++ libebook/e-vcard.c	20 Feb 2005 18:26:40 -0000
@@ -932,6 +932,17 @@
 	return a;
 }
 
+/**
+ * e_vcard_remove_attributes
+ * evc: vcard object
+ * attr_group : group name of attributes to be removed
+ * attr_name  : name of the arributes to be removed
+ *
+ * Removes all the attributes with group name and attribute name equal to 
+ * passed in values. If passed in group name is NULL or empty string, it removes all the attributes 
+ * with passed in name irrespective of their group names
+ */
+
 void
 e_vcard_remove_attributes (EVCard *evc, const char *attr_group, const char *attr_name)
 {
@@ -947,7 +958,7 @@
 
 		next_attr = attr->next;
 
-		if (((!attr_group && !a->group) ||
+		if (((!attr_group || *attr_group == '\0') ||
 		     (attr_group && !g_ascii_strcasecmp (attr_group, a->group))) &&
 		    ((!attr_name && !a->name) || !g_ascii_strcasecmp (attr_name, a->name))) {
 


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