[KJots] Port to NoteMessageWrapper
ClosedPublic

Authored by poboiko on Apr 26 2020, 10:00 PM.

Details

Summary

Drop code that interacts directly with KMime::Message, and use handy NoteUtils::NoteMessageWrapper instead.
It also allows setting of lastModifiedDate (which will become useful useful as sort role).
Also, drop DocumentCursorPositionRole role for model, which is not used anywhere.

Note that there is large code overlap between NoteCreatorAndSelector and LocalResourceCreator.
Will do something with it in the following patches.

Test Plan

Code compiles, new books / pages are still created

Diff Detail

Repository
R573 KJots
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
poboiko created this revision.Apr 26 2020, 10:00 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptApr 26 2020, 10:00 PM
poboiko requested review of this revision.Apr 26 2020, 10:00 PM
dvratil requested changes to this revision.Apr 27 2020, 10:17 AM
dvratil added inline comments.
src/kjotsmodel.cpp
185

Remove the extra spaces inside parentheses.

237

Leave QLatin1String here - it is preferred to use the QLatin1String overloads over QString ones when using string literals. Or even better, if there's QStringView overload present, use that one: doc.startsWith(u"<!DOCTYPE")

src/localresourcecreator.cpp
149–150

Can be shortened to

item.attribute<Akonadi::EntityDisplayAttribute>(Akonadi::Item::AddIfMissing)->setIconName(QStringLiteral("text-plain"));
This revision now requires changes to proceed.Apr 27 2020, 10:17 AM
poboiko updated this revision to Diff 81326.Apr 27 2020, 10:35 AM
poboiko marked 2 inline comments as done.

Address raised points (EDA code also can be changed in the akonadi_next/notecreatorandselector.cpp)

dvratil accepted this revision.Apr 27 2020, 10:36 AM

Thanks for the fixes.

This revision is now accepted and ready to land.Apr 27 2020, 10:36 AM
This revision was automatically updated to reflect the committed changes.