[Kde-pim] Tomboy resource: Write access

Stefan Staeglich staeglis at informatik.uni-freiburg.de
Sat Jun 25 12:41:35 BST 2016


Hello,

thank you for you answer. It helped a lot.

I have two another question. Reading the notes in KJots provokes often an 
UploadJob although there aren't any real changes. I hoped that the second 
parameter parts of the method
itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &parts)
could help, but the content don't seems to be different if there are real 
changes. Or have I overseen something?

An is it possible to create an String like 2009-04-19T21:29:23.2197340-07:00 
with QDateTime containing the same informations?

Thanks,
Stefan

Am Freitag, 24. Juni 2016, 15:29:42 schrieb Daniel Vrátil:
> On Friday, June 24, 2016 12:41:22 PM CEST Stefan Staeglich wrote:
> > Hello,
> > 
> > I'm working now on the write access of my resource. The deletion of a note
> > works successfully now :)
> > 
> > But there is a problem with adding and modifying. I thought I could do
> > this
> > analogue to the read access working with
> > item.payload<KMime::Message::Ptr>(), but this seems to be NULL.
> 
> Hi,
> 
> it's not clear to me where you are trying to call item.payload<..>(), but if
> you are calling it on an Item you get as an argument in itemAdded()/
> itemChanged() in your Resource, you must make sure you have the correct
> ItemFetchScope set, i.e. in your Resoure constructor you have to add
> 
> changeRecorder()->itemFetchScope().fetchFullPayload(true);
> 
> otherwise the Resource will only retrieve Items with the elementary metadata
> without the actual payload. Note that in itemRemoved() calling
> item.payload<...>() will always return a null pointer, because by the time
> itemRemoved() is called in your resource the Item no longer exists in
> Akonadi and so the payload cannot be provided.
> 
> If you are retrieving the Item manually via ItemFetchJob (be it in your
> resource or in an application), you have to do the same thing, i.e.
> 
> job->itemFetchScope().fetchFullPayload(true);
> 
> There are more options you can set in ItemFetchScope (there's also
> CollectionFetchScope btw). If you ever feel like the Items or Collections
> you are being given don't have all the information you would expect them to
> have, check if the fetch scope is correct.
> 
> Cheers,
> Dan
> 
> > Is this so correct, or is that a bug of KJots and KNote?
> > 
> > Thanks,
> > Stefan
> > _______________________________________________
> > 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/
_______________________________________________
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