evolution r35852 - in trunk/addressbook: . gui/contact-list-editor



Author: mcrha
Date: Mon Jul 28 07:37:49 2008
New Revision: 35852
URL: http://svn.gnome.org/viewvc/evolution?rev=35852&view=rev

Log:
2008-07-28  Milan Crha  <mcrha redhat com>

	** Fix for bug #544383

	* gui/contact-list-editor/e-contact-list-editor.c:
	(e_contact_list_editor_get_contact): Put list members in reverse order,
	because 'e_vcard_add_attribute' uses prepend, thus changes order on
	every single save of the contact list.



Modified:
   trunk/addressbook/ChangeLog
   trunk/addressbook/gui/contact-list-editor/e-contact-list-editor.c

Modified: trunk/addressbook/gui/contact-list-editor/e-contact-list-editor.c
==============================================================================
--- trunk/addressbook/gui/contact-list-editor/e-contact-list-editor.c	(original)
+++ trunk/addressbook/gui/contact-list-editor/e-contact-list-editor.c	Mon Jul 28 07:37:49 2008
@@ -1334,6 +1334,7 @@
 	GtkTreeIter iter;
 	gboolean iter_valid;
 	const gchar *text;
+	GSList *attrs = NULL, *a;
 
 	g_return_val_if_fail (E_IS_CONTACT_LIST_EDITOR (editor), NULL);
 
@@ -1367,13 +1368,20 @@
 
 		gtk_tree_model_get (model, &iter, 0, &dest, -1);
 		attr = e_vcard_attribute_new (NULL, EVC_EMAIL);
-		e_vcard_add_attribute (E_VCARD (contact), attr);
+		attrs = g_slist_prepend (attrs, attr);
 		e_destination_export_to_vcard_attribute (dest, attr);
 		g_object_unref (dest);
 
 		iter_valid = gtk_tree_model_iter_next (model, &iter);
 	}
 
+	/* Put it in reverse order because e_vcard_add_attribute also uses prepend,
+	   but we want to keep order of mails there. Hopefully noone will change
+	   the behaviour of the e_vcard_add_attribute. */
+	for (a = attrs; a; a = a->next) {
+		e_vcard_add_attribute (E_VCARD (contact), a->data);
+	}
+
 	return contact;
 }
 



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