Version: (using KDE 4.2.85) OS: Linux Installed from: SuSE RPMs After mounting a new partition (19GiB free) at ~/Videos the original dir ~/Videos-Home (subdir of /home) shows the wrong free disk space (19 GiB) instead of 8 GiB. When I rename the old dir from Videos-Home to another name, where the second dirname "Videos" is not part of (e.g. Video-Home, without the "s") the size is displayed korrectly. It's not a hi-priority bug. Just wanted to report it.
Still reproducing using dolphin 2.1 . To make the report clear, the two folders are "~/Videos"(the mount point) and "~/Videos-Home" . Actually, the same problem can be reproduced using "~/book" ( the mount point) and "~/books" (a empty folder) .
This is actually a bug of kdelibs. in kdelibs/kio/kfile/kdiskfreespaceinfo.cpp KDiskFreeSpaceInfo KDiskFreeSpaceInfo::freeSpaceInfo( const QString& path ) { ... KMountPoint::Ptr mp = KMountPoint::currentMountPoints().findByPath( path ); ... } in kdelibs/kdecore/io/kmountpoint.cpp KMountPoint::Ptr KMountPoint::List::findByPath(const QString& path) const { ... int max = 0; KMountPoint::Ptr result; for (const_iterator it = begin(); it != end(); ++it) { const QString mountpoint = (*it)->d->mountPoint; const int length = mountpoint.length(); if (realname.startsWith(mountpoint) && length > max) { max = length; result = *it; // keep iterating to check for a better match (bigger max) } } } So if "/home/myself/book" is a mount point, "/home/myself/books" will be seen as belonging to the partition mounted at "/home/myself/book", which is clearly wrong.
Resetting assignee to default as per bug #305719
Good investigation, Jekyll! Maybe one could solve this by using KUrl::isParentOf(const KUrl&), rather than QString:.startsWith(const QString&)?
Git commit 4f2ecbabfa5bec07985175798ea20d90bdca9f82 by Frank Reininghaus. Committed on 28/04/2013 at 22:19. Pushed by freininghaus into branch 'KDE/4.10'. Fix KMountPoint::List::findByPath(): /books is not a child of /book Thanks to Jekyll Wu for the analysis and to David Faure for pointing out another problem which I had missed. FIXED-IN: 4.10.3 REVIEW: 110225 M +20 -1 kdecore/io/kmountpoint.cpp http://commits.kde.org/kdelibs/4f2ecbabfa5bec07985175798ea20d90bdca9f82