D13048: Move redundant logic in KIO::iconNameForUrl() into KFileItem::iconName()

David Faure noreply at phabricator.kde.org
Thu Jun 27 19:58:46 BST 2019


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

INLINE COMMENTS

> global.cpp:251
> +            KIO::UDSEntry entry = job->statResult();
> +            const KFileItem item = KFileItem(entry, url);
> +            i = item.iconName();

I hate nested event loops (job->exec()). And I wonder if you need one.
KFileItem is able to stat local files all by itself, in process. So, wouldn't this work?

  const KFileItem item(url, mt.name());
  i = item.iconName();

> global.cpp:255
> +
> +    // It's non-local and maybe on a slow filesystem
> +    } else {

It's a bit confusing to me to have this comment before the "else" statement, rather than inside the "else {" block...

REPOSITORY
  R241 KIO

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

To: ngraham, #frameworks, broulik, meven, apol, dfaure
Cc: apol, kde-frameworks-devel, LeGast00n, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190627/d9fff30b/attachment.html>


More information about the Kde-frameworks-devel mailing list