D29094: [KJotsEdit] Fix links handling in editing mode

Daniel Vrátil noreply at phabricator.kde.org
Fri Apr 24 08:24:34 BST 2020


dvratil requested changes to this revision.
dvratil added a comment.
This revision now requires changes to proceed.


  Nice work, just a small nitpick :)

INLINE COMMENTS

> kjotsedit.cpp:405-430
> +        auto helpEvent = static_cast<QHelpEvent *>(event);
> +        QUrl url(anchorAt(helpEvent->pos()));
> +        QString message;
> +
> +        if (url.isValid()) {
> +            if (url.scheme() == QStringLiteral("kjots")) {
> +                QModelIndex idx = KJotsModel::modelIndexForUrl(m_selectionModel->model(), url);

I would move this to a separate function to keep the dispatch code in `event()` clean and short. I find it easier to find out which all events the handler handles if it's just a bunch of `if (isSomeEvent) someEvent(event);`

REPOSITORY
  R573 KJots

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

To: poboiko, dvratil
Cc: kde-pim, fbampaloukas, dcaliste, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20200424/4975a08e/attachment-0001.html>


More information about the kde-pim mailing list