Re: [evolution-patches] e-d-s patch for addressbook bug #51977



On Tue, 2004-03-30 at 17:25 -0800, Chris Toshok wrote:
> the name of the category list attribute changed from "category" in 1.4
> to "category_list" in 1.5.  one liner.

actually this flushed out a bug in EContact dealing with LIST type
attributes (of which "category_list" is the only one.)

revised patch attached.

Chris


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/ChangeLog,v
retrieving revision 1.110
diff -u -r1.110 ChangeLog
--- ChangeLog	30 Mar 2004 08:28:55 -0000	1.110
+++ ChangeLog	31 Mar 2004 06:34:55 -0000
@@ -1,5 +1,16 @@
 2004-03-30  Chris Toshok  <toshok ximian com>
 
+	[ backend portion of fix for #51977 ]
+	
+	* libedata-book/e-book-backend-sexp.c (prop_info_table): category
+	-> category_list.
+
+	* libebook/e-contact.c (e_contact_get_property): LIST fields (of
+	which there is one, "category_list"), need to duplicate both the
+	list and the list elements before returning from ::get_property.
+
+2004-03-30  Chris Toshok  <toshok ximian com>
+
 	[ looks like this fixes #55527 ]
 	* libedata-book/e-data-book-view.c (e_data_book_view_construct):
 	use bonobo_object_dup_ref instead of CORBA_Object_duplicate here.
Index: libedata-book/e-book-backend-sexp.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libedata-book/e-book-backend-sexp.c,v
retrieving revision 1.3
diff -u -r1.3 e-book-backend-sexp.c
--- libedata-book/e-book-backend-sexp.c	21 Jan 2004 23:29:01 -0000	1.3
+++ libedata-book/e-book-backend-sexp.c	31 Mar 2004 06:34:55 -0000
@@ -218,7 +218,7 @@
 	LIST_PROP ( "email",     compare_email ),
 	LIST_PROP ( "phone",     compare_phone ),
 	LIST_PROP ( "address",   compare_address ),
-	LIST_PROP ( "category",  compare_category ),
+	LIST_PROP ( "category_list",  compare_category ),
 };
 static int num_prop_infos = sizeof(prop_info_table) / sizeof(prop_info_table[0]);
 
Index: libebook/e-contact.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libebook/e-contact.c,v
retrieving revision 1.27
diff -u -r1.27 e-contact.c
--- libebook/e-contact.c	13 Mar 2004 22:37:26 -0000	1.27
+++ libebook/e-contact.c	31 Mar 2004 06:34:57 -0000
@@ -1085,8 +1085,14 @@
 	else if (info->t & E_CONTACT_FIELD_TYPE_LIST) {
 		EVCardAttribute *attr = e_contact_get_first_attr (contact, info->vcard_field_name);
 
-		if (attr)
-			g_value_set_pointer (value, e_vcard_attribute_get_values (attr));
+		if (attr) {
+			GList *list = g_list_copy (e_vcard_attribute_get_values (attr));
+			GList *l;
+			for (l = list; l; l = l->next)
+				l->data = g_strdup (l->data);
+
+			g_value_set_pointer (value, list);
+		}
 	}
 	else if (info->t & E_CONTACT_FIELD_TYPE_LIST_ELEM) {
 		if (info->t & E_CONTACT_FIELD_TYPE_STRING) {


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