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

Reply via email to