D29073: [KJots] Port bookmarks code, unify link handling code

Igor Poboiko noreply at phabricator.kde.org
Tue Apr 21 23:20:39 BST 2020


poboiko created this revision.
poboiko added a reviewer: dvratil.
poboiko requested review of this revision.

REVISION 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

BRANCH
  fix-bookmarks (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D29073

AFFECTED FILES
  src/kjotsbookmarks.cpp
  src/kjotsbookmarks.h
  src/kjotsbrowser.cpp
  src/kjotsbrowser.h
  src/kjotslinkdialog.cpp
  src/kjotsmodel.cpp
  src/kjotsmodel.h
  src/kjotswidget.cpp
  src/kjotswidget.h
  themes/default/pagetemplate.html

To: poboiko, dvratil
Cc: kde-pim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20200421/8f30a5c3/attachment.html>


More information about the kde-pim mailing list