D20938: Add Mounts Backend

Nathaniel Graham noreply at phabricator.kde.org
Fri May 3 14:37:16 BST 2019


ngraham added a comment.


  In D20938#460029 <https://phabricator.kde.org/D20938#460029>, @hallas wrote:
  
  > I have tried to modify the fstab backend to also show fuse mounts and a //very// simple prototype is this:
  >
  >   diff --git a/src/solid/devices/backends/fstab/fstabhandling.cpp b/src/solid/devices/backends/fstab/fstabhandling.cpp
  >   index 63130c6..3632b52 100644
  >   --- a/src/solid/devices/backends/fstab/fstabhandling.cpp
  >   +++ b/src/solid/devices/backends/fstab/fstabhandling.cpp
  >   @@ -121,6 +121,11 @@ bool _k_isFstabNetworkFileSystem(const QString &fstype, const QString &devName)
  >        return false;
  >    }
  >   
  >   +bool _k_isFstabFuseFileSystem(const QString &fstype)
  >   +{
  >   +    return fstype.startsWith(QLatin1String("fuse."));
  >   +}
  >   +
  >    void Solid::Backends::Fstab::FstabHandling::_k_updateFstabMountPointsCache()
  >    {
  >        if (globalFstabCache->m_fstabCacheValid) {
  >   @@ -288,7 +293,7 @@ void Solid::Backends::Fstab::FstabHandling::_k_updateMtabMountPointsCache()
  >        STRUCT_MNTENT fe;
  >        while (GETMNTENT(mnttab, fe)) {
  >            QString type = QFile::decodeName(MOUNTTYPE(fe));
  >   -        if (_k_isFstabNetworkFileSystem(type, QString())) {
  >   +        if (_k_isFstabNetworkFileSystem(type, QString()) || _k_isFstabFuseFileSystem(type)) {
  >                const QString device = QFile::decodeName(FSNAME(fe));
  >                const QString mountpoint = QFile::decodeName(MOUNTPOINT(fe));
  >                globalFstabCache->m_mtabCache.insert(device, mountpoint);
  >
  >
  > the only caveat is that the mount points shows up in the "Remote" list, but that is probably easy to fix.
  
  
  Yeah, that'll be fixable in https://cgit.kde.org/kio.git/tree/src/filewidgets/kfileplacesmodel.cpp

REPOSITORY
  R245 Solid

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

To: hallas, #frameworks, ngraham, elvisangelaccio, broulik, bruns
Cc: svuorela, nicolasfella, ivan, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190503/c3254fe3/attachment.html>


More information about the Kde-frameworks-devel mailing list