GNOME Bugzilla – Bug 644194
EAddressbookModel: Logic error in remove_contact()
Last modified: 2011-04-19 07:36:24 UTC
When an addressbook backend notifies about multiple removals of contacts, the remove_contact() function doesn't remove entries in the correct order. Patch included. modify_contact() could probably also have a sanity check for string comparison with a "removed" contact (similar to remove_contact() function)
Created attachment 182815 [details] [review] fixes correct order of removed contacts
Ah, you're right. I didn't see it at first but the indices array needs to be sorted in descending order since g_ptr_array_remove_index() shifts all subsequent elements down one to fill the gap. I was probably thinking of linked lists when I wrote that. Good catch! I embellished the patch a bit and also added more sanity checks to modify_contact(). Fixed for 2.92.92 in: http://git.gnome.org/browse/evolution/commit/?id=a654e38eca0d6cead861e1d78285d3ecfb4925a0
This patch has regression, see bug #645610