[Kde-pim] Tomboy resource: Questions to the notes specific stuff
Daniel Vrátil
dvratil at kde.org
Sat Jun 18 23:44:35 BST 2016
On Saturday, June 18, 2016 1:48:43 PM CEST Stefan Staeglich wrote:
> Hi Dan,
>
> I have overlooked your message until now. Thanks you it helps a lot.
>
> Is the use of setPayload correct?
> KMime::Message::Ptr akonadiNote = KMime::Message::Ptr(new KMime::Message);
> akonadiNote->subject(true)->fromUnicodeString( jsonNote["title"].toString(),
> "utf-8" );
> akonadiNote->contentType()->setMimeType("text/plain");
> akonadiNote->contentType()->setCharset("utf-8");
> akonadiNote->contentTransferEncoding(true)-
>
> >setEncoding(KMime::Headers::CEquPr);
>
> akonadiNote->mainBodyPart()->fromUnicodeString(jsonNote["note-
> content"].toString().toUtf8());
> akonadiNote->assemble();
> resultItem.setPayload<KMime::Message::Ptr>(akonadiNote);
Looks good to me.
(You don't even have to specify the type in setPayload<>, the compiler is
clever enough to figure it out usually).
Remember to call resultItem.setMimeType(), setRemoteId() and
setParentCollection() as well.
>
> I want now to test my resource. First I need to test the OAuth
> authentication, but it don't work. How can I read out the debug output like
> qCDebug(log_tomboynotesresource) << "Resource started";
First make sure the logging group is enabled, by exporting it via
QT_LOGGING_RULES env variable:
export QT_LOGGING_RULES="log_tomboynotesresource.* = true"
If you want all other debug info as well, you can do
export QT_LOGGING_RULES="* = true
qt.* = false"
This enables all logging output except for Qt itself, because Qt is very
verbose. Note the newline after "true", that's intended.
Alternatively, you can specify the rules in a config file:
[Rules]
* = true
qt.* = false
and then
export QT_LOGGING_CONF=/path/to/the/file
Finally, you need to start Akonadi from the command line:
akonadictl restart
Now you'll see debug output from Akonadi as well as all the resources (unless
you only enabled log_tomboynotesresource, then you'll only see output from
that).
Dan
>
> Thanks,
> Stefan
>
> Am Samstag, 18. Juni 2016, 10:10:01 schrieb Daniel Vrátil:
> > Hi Stefan,
> >
> > On Thursday, June 16, 2016 10:58:33 PM CEST Stefan Staeglich wrote:
> > > Hello,
> > >
> > > I'm working on the Akonadi resource for Tomboy servers. Now I have
> > > questions to the notes specific stuff.
> > >
> > > In general you can set the data with item.setpaylod. How I have to do
> > > it with the notes content? Which informations are important?
> >
> > setMimeType
> > setPayload
> > setRemoteId
> > setParentCollection
> >
> > > Is it correct using "application/x-vnd.kde.notes" as mime type?
> >
> > It's application/x-vnd.akonadi.note
> >
> >
> > Dan
> >
> > > 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/
--
Daniel Vrátil
www.dvratil.cz | dvratil at kde.org
IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)
GPG Key: 0x4D69557AECB13683
Fingerprint: 0ABD FA55 A4E6 BEA9 9A83 EA97 4D69 557A ECB1 3683
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20160619/2679c01e/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