D10155: Use the much faster urls() method from QMimeData

David Faure noreply at phabricator.kde.org
Sat Feb 3 00:43:53 UTC 2018


dfaure added inline comments.

INLINE COMMENTS

> kurlmimedata.cpp:75
> +    QByteArray ba = mimeData->data(firstMimeType);
> +    if (ba.isEmpty() || firstMimeType == QStringLiteral("text/uri-list")) {
>          // Extracting uris from text/uri-list, use the much faster QMimeData method urls()

This can't be right, it would mean ba is ignored when firstMimeType==text/uri-list (which would mean the call to data() above was for nothing).

Since the method to call (data() or urls()) depends on the mimetype, either the whole idea of swapping the mimetypes has to be dropped, or as Milian suggests, a helper with an if() should encapsulate this (so we can call it in both places) (but that's more string comparisons....).

To make it fast I'd do, well, OK the code wouldn't fit into this margin, let's make a separate RR: https://phabricator.kde.org/D10257

REPOSITORY
  R244 KCoreAddons

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

To: jtamate, #frameworks, dfaure
Cc: mwolff, michaelh, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180203/e4120e6e/attachment.html>


More information about the Kde-frameworks-devel mailing list