[Kde-pim] Review Request: Make Entity::addAttribute() do nothing when re-adding the same attribute

David Jarvie djarvie at kde.org
Wed Dec 23 01:07:36 GMT 2009


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

Review request for KDE PIM.


Summary
-------

Entity::addAttribute() currently always first deletes any existing attribute of the same type, before adding the new one. If the new attribute is the same object as the existing one, this will result in a crash since the new attribute will be deleted before adding it. This patch fixes this, so that nothing happens if the same attribute is re-added.

The unit test is updated to test this.


Diffs
-----

  trunk/KDE/kdepimlibs/akonadi/entity.cpp 1057518 
  trunk/KDE/kdepimlibs/akonadi/tests/collectionattributetest.cpp 1057518 

Diff: http://reviewboard.kde.org/r/2444/diff


Testing
-------

New unit test failed with old Entity code, runs successfully with new code.


Thanks,

David

_______________________________________________
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