diff options
author | Milan Crha <mcrha@redhat.com> | 2008-07-28 15:37:49 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-07-28 15:37:49 +0800 |
commit | c1d96747b0c05c796bcdbde5b3d0d31481c6a10e (patch) | |
tree | e4c2ce76f453a3945b418bca50ee6d1d2041844e | |
parent | 764a1b7b002565c7115be0f0087fcf8f867a475e (diff) | |
download | gsoc2013-evolution-c1d96747b0c05c796bcdbde5b3d0d31481c6a10e.tar.gz gsoc2013-evolution-c1d96747b0c05c796bcdbde5b3d0d31481c6a10e.tar.zst gsoc2013-evolution-c1d96747b0c05c796bcdbde5b3d0d31481c6a10e.zip |
** Fix for bug #544383
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.
svn path=/trunk/; revision=35852
-rw-r--r-- | addressbook/ChangeLog | 9 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.c | 10 |
2 files changed, 18 insertions, 1 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index ac4277aa43..ad2d3d62df 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,12 @@ +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. + 2008-07-20 Andre Klapper <a9016009@gmx.de> * addressbook.error.xml: Fix some strings. See bug #543753. diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index d3121185a6..7039bb5086 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -1334,6 +1334,7 @@ e_contact_list_editor_get_contact (EContactListEditor *editor) 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 @@ e_contact_list_editor_get_contact (EContactListEditor *editor) 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; } |