After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 644194 - EAddressbookModel: Logic error in remove_contact()
EAddressbookModel: Logic error in remove_contact()
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Contacts
2.30.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2011-03-08 12:37 UTC by Jari Urpalainen
Modified: 2011-04-19 07:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fixes correct order of removed contacts (759 bytes, patch)
2011-03-08 12:39 UTC, Jari Urpalainen
none Details | Review

Description Jari Urpalainen 2011-03-08 12:37:20 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)
Comment 1 Jari Urpalainen 2011-03-08 12:39:08 UTC
Created attachment 182815 [details] [review]
fixes correct order of removed contacts
Comment 2 Matthew Barnes 2011-03-08 13:55:27 UTC
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
Comment 3 Milan Crha 2011-04-19 07:36:24 UTC
This patch has regression, see bug #645610