[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] Can't access attributes in serializer
From:       "David Jarvie" <djarvie () kde ! org>
Date:       2013-11-18 14:08:52
Message-ID: 74a4fcf966eb5ac30e48d7a109594e9e.squirrel () www ! sensical ! net
[Download RAW message or body]

On Fri, November 15, 2013 10:34 pm, Volker Krause wrote:
> 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.

Thanks Volker - it was really puzzling until now! I'll update the
documentation too, to explain this.

-- 
David Jarvie.
KDE developer.
KAlarm author - http://www.astrojar.org.uk/kalarm

_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic