D8640: [KDirModel] Emit change for HasJobRole when jobs change

David Faure noreply at phabricator.kde.org
Sun Nov 5 20:44:25 UTC 2017


dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> kdirmodel.cpp:696
> +    std::set_symmetric_difference(urlList.begin(), urlList.end(),
> +                                  m_allCurrentDestUrls.begin(), m_allCurrentDestUrls.end(),
> +                                  std::back_inserter(dirtyUrls));

constBegin() / constEnd(), on the non-const m_allCurrentDestUrls, to avoid a detach?

> kdirmodel.cpp:703
> +        if (KDirModelNode *node = nodeForUrl(QUrl(dirtyUrl))) {
> +            const QModelIndex idx = q->index(node->rowNumber(), 0);
> +            emit q->dataChanged(idx, idx, {KDirModel::HasJobRole});

You should use indexForNode() instead, to cover the case of the root URL, and to set the proper internal pointer in the index (for tree models).

REPOSITORY
  R241 KIO

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

To: broulik, #frameworks, dfaure, hein, mwolff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20171105/e99ecaf2/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list