[Kde-pim] Review Request 113180: kmail: do not duplicate contacts when saving distribution list

Jonathan Marten jjm at keelhaul.me.uk
Sun Oct 13 16:28:24 BST 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113180/
-----------------------------------------------------------

(Updated Oct. 13, 2013, 3:28 p.m.)


Review request for KDEPIM.


Changes
-------

Use the retrieved Akonadi items to get the contact data, avoids having to run through two arrays simultaneously.
Style corrected.


Bugs: 325303
    http://bugs.kde.org/show_bug.cgi?id=325303


Repository: kdepim


Description
-------

When saving a distribution list from the KMail composer, each recipient address is searched to see if they already exist.  As described in the referenced bug and at http://lists.kde.org/?l=kde-pim&m=138020586810635&w=2, if an address is not found a new contact is added to the Akonadi database and the distribution list references it by Akonadi ID.  If an address is found then their name and email address is added to the distribution list.

This is surely wrong (logic reversed), an existing contact should be referenced to avoid duplication and an unknown contact added by name/email so as not to add unwanted entries to the address book (and also to avoid a nested event loop).

This change implements that by retaining the Akonadi ID of a searched contact, and using it to create the distribution list (and also recording the email address if that is not the same as the contact's preferred email).


Diffs (updated)
-----

  messagecomposer/recipient/distributionlistdialog.cpp f03aaec 

Diff: http://git.reviewboard.kde.org/r/113180/diff/


Testing
-------

Build kdepim with this change, checked saving of distribution lists with known and unknown contacts.  No unwanted contacts added to address book, distribution list entry stored as:

Known contact, using preferred email:
    <contactReference uid="10104" gid=""/>

Known contact but using secondary email:
    <contactReference uid="345" gid="" preferredEmail="xxx at somedomain.com"/>

Unknown contact:
    <contactData name="Anonymous Person" email="their.email at yahoo.co.co"/>


Thanks,

Jonathan Marten

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list