author | llornkcor <llornkcor> | 2002-08-06 13:59:45 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-06 13:59:45 (UTC) |
commit | 64888e9cd2f4c8f40f08a6712e2fd27220ff14ad (patch) (side-by-side diff) | |
tree | 862bcda0849bf79b3eeb6fbab1ef18d08b005dc9 /noncore/apps/advancedfm/advancedfm.cpp | |
parent | b980135ff5ce5447ca41411b6ace74ce2803fadb (diff) | |
download | opie-64888e9cd2f4c8f40f08a6712e2fd27220ff14ad.zip opie-64888e9cd2f4c8f40f08a6712e2fd27220ff14ad.tar.gz opie-64888e9cd2f4c8f40f08a6712e2fd27220ff14ad.tar.bz2 |
re-add missing diskspace function
Diffstat (limited to 'noncore/apps/advancedfm/advancedfm.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 20 |
1 files changed, 16 insertions, 4 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; |