https://bugs.kde.org/show_bug.cgi?id=527838

--- Comment #2 from Mr.E1999 <[email protected]> ---
Autopsy report:
KIO's isSlow() returns true on FUSE/mergerfs mounts because
KMountPoint::probablySlow() classifies FUSE as a slow filesystem, causing
KFileItem::iconName() to skip reading the .directory file that sets folder
colors.


Here's the fixed code - two changes in ~/projects/kio/src/core/kfileitem.cpp:

 ### 1. Add the isFuseMount() helper (before isDirectoryMounted())

 ```cpp
   #ifndef Q_OS_WIN
   static bool isFuseMount(const QString &localPath)
   {
       struct statfs fsBuf;
       if (statfs(localPath.toUtf8().constData(), &fsBuf) != 0) {
           return false;
       }
   #ifdef FUSE_SUPER_MAGIC
       return fsBuf.f_type == FUSE_SUPER_MAGIC;
   #else
       return fsBuf.f_type == 0x65735546; // FUSE_SUPER_MAGIC from
<linux/fuse.h>
   #endif
   }
   #endif
 ```

 ### 2. Change the readDotDirectoryFile condition (in KFileItem::iconName())

 Before:

 ```cpp
   bool readDotDirectoryFile = isDirectoryMounted(url) && !d->isSlow();
 ```

 After:

 ```cpp
   bool readDotDirectoryFile = isDirectoryMounted(url) && (!d->isSlow() ||
isFuseMount(url.toLocalFile()));
 ```

 ### Include needed

 Add this at the top of the file (inside #ifndef Q_OS_WIN):

 ```cpp
   #include <sys/statfs.h>
 ```

 ### What changed

 The isDirectoryMounted() function itself was left unchanged (reverted back to
original). Only the readDotDirectoryFile condition now bypasses the isSlow()
check when the path is on a FUSE mount, so
 .directory is read even though isSlow() returns true on FUSE/mergerfs.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to