[Kde-pim] [PATCH] Akonadi::ItemModel doesn't update its item cache
Dmitry Ivanov
vonami at gmail.com
Sat Jun 21 07:38:49 BST 2008
On Saturday 21 June 2008 00:27:46 Dmitry Ivanov wrote:
> The attached patch fixed this bug. IIUC, qHash() for Akonadi::Item is
> computed from id there is no need to update 'itemHash', only the value in
> ItemContainer from 'items'.
Partially wrong. In this particular case of ItemModel the value of a key
itself (in 'itemHash') doesn't matter since the keys are not used (only for
lookup and qHash() returns the same hash value). But if someone someday
decides to obtain all keys from 'itemHash' he will get wrong data. The new
patch updates 'itemHash' as well as 'items'.
BTW, I wonder why does 'itemHash' use Akonadi::Item as a key? I think
Akonadi::Item::Id would be enough.
--
Dmitry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: akonadi-itemmodel-fix-v2.diff
Type: text/x-patch
Size: 448 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20080621/3b60ba39/attachment.bin>
-------------- next part --------------
_______________________________________________
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