[KJots] Port bookmarks code, unify link handling code
Summary:
Link creation was present in three places:
- Inside template pagetemplate.html
- Inside KJotsLinkDialog, the dialog to add links
- Inside KJotsBookmarks
Unify it inside KJotsModel: provide a UrlRole for QModelIndex::data.
Provide an url property for KJotsEntity, so it could also be used in templates.
Link handling was also duplicated in two places:
- Inside KJotsBookmarks
- Inside KJotsBrowser
Unify it too, so both classes emit a signal with QUrl property, which is then caught by KJotsWidget
(which actually gets the job done)
Test Plan:
- Navigation in the "Browser mode" works, clicking at "books", "pages" and "page headers" (which should switch to edit mode)
- Bookmarks also work, they are created with fancy icons, and navigation works (both with "pages" and "books")
- Link dialog creates proper links pointing where they should
- External links are being opened by an external web browser
Reviewers: dvratil
Reviewed By: dvratil
Subscribers: kde-pim
Tags: KDE PIM
Differential Revision: https://phabricator.kde.org/D29073