[KJots] Add StandardNoteActionManager
ClosedPublic

Authored by poboiko on May 8 2020, 4:44 PM.

Details

Summary

This adds a class that stores note-related actions. Currently those are:

  • Create Note
  • Lock / Unlock
  • Change Color

It also provides access to Akonadi::StandardActionManager, which allows to reuse the standard actions for:

This was written with possible triple-column UI (like KMail / KAddressBook has) in mind, where item / collection views could be separated.

This slightly changes the behavior:

  • "Delete selection" action (allowed to delete notes and books simultaneously) was removed
  • "Delete Note / Book" are now disabled if note / book is locked
  • They also now show confirmation dialog
  • A slight change in terminology (instead of "Page" I suggest just using "Note"; TODO: need to do it consistently)
Test Plan

Tested changed actions, they seem to be functional

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.May 8 2020, 4:44 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMay 8 2020, 4:44 PM
poboiko requested review of this revision.May 8 2020, 4:44 PM
dvratil accepted this revision.May 8 2020, 8:47 PM

Nice job, just some suggestions for improvements...

src/noteshared/standardnoteactionmanager.cpp
412

Use std::unique_ptr for automatic memory management (or just allocate it on heap), you already initialize it in the constructor anyway.

598

Shouldn't be needed.

src/noteshared/standardnoteactionmanager.h
185

Make it an std::unique_ptr<Private> const d, so you don't have to delete it manually.

This revision is now accepted and ready to land.May 8 2020, 8:47 PM
poboiko updated this revision to Diff 82342.May 9 2020, 9:59 AM

Thanks!

Use unique_ptr, remove moc-file include

This revision was automatically updated to reflect the committed changes.