[Kde-pim] Review Request: Add capability to merge items containing multiple parts, and to know what parts are available for a given item.

Thomas McGuire mcguire at kde.org
Fri Aug 21 17:08:19 BST 2009


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

Ship it!


Looks good, design makes sense to me.
I still spotted missing spaces inside of parenthesis, though :P
And some public classes of functions are not yet documented.


/trunk/KDE/kdepimlibs/akonadi/item.h
<http://reviewboard.kde.org/r/1365/#comment1430>

    Would be good if this says that the payload() is modified, and how that is done, i.e. using the serializerV2's merge() function.



/trunk/KDE/kdepimlibs/akonadi/itemserializer.cpp
<http://reviewboard.kde.org/r/1365/#comment1431>

    Is const QByteArray _&_ faster?
    I don't know actually, but it should save one call to the implicit sharing code.


- Thomas


On 2009-08-21 15:04:33, Stephen Kelly wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/1365/
> -----------------------------------------------------------
> 
> (Updated 2009-08-21 15:04:33)
> 
> 
> 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/entitytreemodel_p.cpp 1014128 
>   /trunk/KDE/kdepimlibs/akonadi/item.h 1014128 
>   /trunk/KDE/kdepimlibs/akonadi/CMakeLists.txt 1014128 
>   /trunk/KDE/kdepimlibs/akonadi/entitytreemodel.h 1014128 
>   /trunk/KDE/kdepimlibs/akonadi/entitytreemodel.cpp 1014128 
>   /trunk/KDE/kdepimlibs/akonadi/item.cpp 1014128 
>   /trunk/KDE/kdepimlibs/akonadi/itemserializer.cpp 1014128 
>   /trunk/KDE/kdepimlibs/akonadi/itemserializer_p.h 1014128 
>   /trunk/KDE/kdepimlibs/akonadi/itemserializerplugin.h 1014128 
>   /trunk/KDE/kdepimlibs/akonadi/itemserializerplugin.cpp 1014128 
>   /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