D23420: Use solid to check if a KFileItem is located on a network mount

Méven Car noreply at phabricator.kde.org
Thu Sep 5 16:23:02 BST 2019


meven added a comment.


  I didn't know about `KMount`
  
  Gwenview uses it as we are trying here :
  
    bool urlIsFastLocalFile(const QUrl &url)
    {
        if (!url.isLocalFile()) {
            return false;
        }
    
        KMountPoint::List list = KMountPoint::currentMountPoints();
        KMountPoint::Ptr mountPoint = list.findByPath(url.toLocalFile());
        if (!mountPoint) {
            // We couldn't find a mount point for the url. We are probably in a
            // chroot. Assume everything is fast then.
            return true;
        }
    
        return !mountPoint->probablySlow();
    }

REPOSITORY
  R241 KIO

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

To: meven, dfaure, #frameworks
Cc: broulik, 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/20190905/75d03500/attachment.html>


More information about the Kde-frameworks-devel mailing list