[Kde-pim] Review Request: Add capability to merge items containing multiple parts, and to know what parts are available for a given item.
Stephen Kelly
steveire at gmail.com
Thu Aug 20 11:24:43 BST 2009
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/1365/
-----------------------------------------------------------
Review request for KDE PIM.
Summary
-------
This patch adds a ItemSerializerPluginV2 class which contains API for merging two items, and for returning which parts are available for a given item.
For 'legacy' serializers which use ItemSerializerPlugin, there is a slower method of merging by multiple deserializations. The default implementation of merge also uses this slow method.
I also need to do a dynamic_cast of plugins in the ItemSerializer class so that it can know the capabilities of a plugin.
Both merge, and availableParts are available through the Item class.
These changes allow the ETM to function properly when a itemChanged signal is recieved. Current behaviour is to over-write the item currently in the internal data structure with the newly recieved item. The problem is that if the new item does not contain parts which the old item did, the old parts are discarded. The new behaviour is to merge the parts.
Additionally, the available parts are made available through the model, which means that a model could by default only fetch the Envelope part, and fetch the body on click, and fetch an attachment from akonadi when it is selected. A PartFetcher class is provided for convenience. Doing this operation though a generic, very ugly hack with setData/data allows the use of the PartFetcher class through proxy models, and it also allows the model to cache parts. That means that if the user clicks several emails for example, their body parts are retrieved from Akonadi only once, and cached, rather than being fetched multiple times as is the current behaviour.
Diffs
-----
/trunk/KDE/kdepimlibs/akonadi/CMakeLists.txt 1013604
/trunk/KDE/kdepimlibs/akonadi/entitytreemodel.h 1013604
/trunk/KDE/kdepimlibs/akonadi/entitytreemodel.cpp 1013604
/trunk/KDE/kdepimlibs/akonadi/entitytreemodel_p.h 1013604
/trunk/KDE/kdepimlibs/akonadi/entitytreemodel_p.cpp 1013604
/trunk/KDE/kdepimlibs/akonadi/item.h 1013604
/trunk/KDE/kdepimlibs/akonadi/item.cpp 1013604
/trunk/KDE/kdepimlibs/akonadi/itemserializer.cpp 1013604
/trunk/KDE/kdepimlibs/akonadi/itemserializer_p.h 1013604
/trunk/KDE/kdepimlibs/akonadi/itemserializerplugin.h 1013604
/trunk/KDE/kdepimlibs/akonadi/itemserializerplugin.cpp 1013604
/trunk/KDE/kdepimlibs/akonadi/partfetcher.h PRE-CREATION
/trunk/KDE/kdepimlibs/akonadi/partfetcher.cpp PRE-CREATION
Diff: http://reviewboard.kde.org/r/1365/diff
Testing
-------
Temporarily modified KJotsResource to make two parts available, title and content. The content is only fetched when a page is clicked, and it is noticably cached.
http://websvn.kde.org/?view=rev&revision=1013595
Thanks,
Stephen
_______________________________________________
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