Diffusion KJots 800f804d7633

[KJots] Port bookmarks code, unify link handling code

Authored by poboiko on Apr 21 2020, 10:16 PM.

Description

[KJots] Port bookmarks code, unify link handling code

Summary:
Link creation was present in three places:

  1. Inside template pagetemplate.html
  2. Inside KJotsLinkDialog, the dialog to add links
  3. 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:

  1. Inside KJotsBookmarks
  2. 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:

  1. Navigation in the "Browser mode" works, clicking at "books", "pages" and "page headers" (which should switch to edit mode)
  2. Bookmarks also work, they are created with fancy icons, and navigation works (both with "pages" and "books")
  3. Link dialog creates proper links pointing where they should
  4. 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

Details

Committed
poboikoApr 22 2020, 7:42 AM
Reviewer
dvratil
Differential Revision
D29073: [KJots] Port bookmarks code, unify link handling code
Parents
R573:ca9ab726f3ca: [KJots] Revive printing support
Branches
Unknown
Tags
Unknown