D26407: KFileItem: Improve isSlow to not block when a network mount is unresponsive, make SkipMimeTypeFromContent skip only on slow fs

David Faure noreply at phabricator.kde.org
Thu Jan 16 08:45:24 GMT 2020


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

INLINE COMMENTS

> meven wrote in kfileitem.cpp:787
> I meant this and this what KMountPoint does, better be precise here.

I see. Sorry, I hadn't realized that there is a Q_OS_ANDROID check in kmountpoint itself.

> kmountpoint.cpp:437
> +        QFileInfo fileinfo(path);
> +        if (fileinfo.isSymLink()) {
> +            return findByPath(fileinfo.symLinkTarget());

Compared to canonicalPath, this only works if the very last component is a symlink.

If I make /home/dfaure a symlink to /opt/dfaure (because I have more disk space there), then findByPath("/home/dfaure/Documents/foo.odt") used to return the mountpoint for /opt (which was correct) while now it will return the mount point for /home.
isSymlink() will say false because foo.odt isn't a symlink.

I don't see a perfect solution to this. The best we can do IMHO is make things work for local symlinked directories and for remote mounts, but we can't fully avoid slow calls in the case of symlinks-to-remote-mounts.

So I would just call canonicalPath here, once we find out that the orig path isn't a slow mount. Yes it might point to a slow mount, but IMHO that's the user asking for (performance) trouble :)

REPOSITORY
  R241 KIO

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

To: meven, #frameworks, ngraham, broulik, dfaure
Cc: anthonyfieroni, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200116/32b2a1da/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list