[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kio/kfile
From:       David Faure <faure () kde ! org>
Date:       2008-12-31 19:51:04
Message-ID: 1230753064.911028.7033.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 903954 by dfaure:

Prefer mountPoint if available, so that it even works with non-existing files.
(in my tv-recording app I'm showing free disk space for the to-be-created file typed by the user...)


 M  +3 -1      kdiskfreespaceinfo.cpp  


--- trunk/KDE/kdelibs/kio/kfile/kdiskfreespaceinfo.cpp #903953:903954
@@ -130,7 +130,9 @@
 #else
     struct statvfs statvfs_buf;
 
-    if (!statvfs(QFile::encodeName(path).constData(), &statvfs_buf)) {
+    // Prefer mountPoint if available, so that it even works with non-existing files.
+    const QString pathArg = info.d->mountPoint.isEmpty() ? path : info.d->mountPoint;
+    if (!statvfs(QFile::encodeName(pathArg).constData(), &statvfs_buf)) {
         info.d->available = statvfs_buf.f_bavail * statvfs_buf.f_frsize;
         info.d->size = statvfs_buf.f_blocks * statvfs_buf.f_frsize;
         info.d->valid = true;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic