[Kde-pim] Can't access attributes in serializer

Volker Krause vkrause at kde.org
Fri Nov 15 22:34:43 GMT 2013


On Monday 28 October 2013 12:46:53 David Jarvie wrote:
> Is it possible to reliably access Item attributes in ItemSerializerPlugin
> classes? I've found that calling AttributeFactory::registerAttribute() in
> the deserialize() method, to register the Attribute class, doesn't have
> any effect - it seems to depend on whether the *application* has called
> registerAttribute() as to whether deserialize() can access the relevant
> Attribute class.

attributes need to be registered before the item is retrieved from the server, 
deserialization happens afterwards. What should work is static initialization 
in the library they are defined in, an example can be found here: 
kdepimlibs/akonadi/kmime/attributeregistrar.cpp (you can probably ignore the 
static lib part). This will automatically register your attributes when the 
corresponding library is loaded.

regards,
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20131115/425b0717/attachment.sig>
-------------- 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