-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 20 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.pro | 2 |
2 files changed, 17 insertions, 5 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index b169a79..7ee78c0 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -19,4 +19,4 @@ -#include <opie/ofileselector.h> -#include <opie/ofiledialog.h> +// #include <opie/ofileselector.h> +// #include <opie/ofiledialog.h> @@ -1734,4 +1734,17 @@ QString AdvancedFm::getFileSystemType(const QString ¤tText) { -QString AdvancedFm::getDiskSpace( const QString &) { +QString AdvancedFm::getDiskSpace( const QString &path) { + struct statfs fss; + if ( !statfs( path.latin1(), &fss ) ) { + int blkSize = fss.f_bsize; + // int totalBlks = fs.f_blocks; + int availBlks = fss.f_bavail; + long mult = blkSize / 1024; + long div = 1024 / blkSize; + if ( !mult ) mult = 1; + if ( !div ) div = 1; + + return QString::number(availBlks * mult / div); + } + return ""; } @@ -1870,3 +1883,2 @@ void AdvancedFm::cancelMenuTimer() { QString AdvancedFm::checkDiskSpace(const QString &path) { - struct statfs fss; diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro index e99ab12..0f0f770 100644 --- a/noncore/apps/advancedfm/advancedfm.pro +++ b/noncore/apps/advancedfm/advancedfm.pro @@ -9,3 +9,3 @@ DEPENDPATH += $(OPIEDIR)/include DESTDIR = $(OPIEDIR)/bin -LIBS += -lqpe -lopie +LIBS += -lqpe |