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 | |
parent | b980135ff5ce5447ca41411b6ace74ce2803fadb (diff) | |
download | opie-64888e9cd2f4c8f40f08a6712e2fd27220ff14ad.zip opie-64888e9cd2f4c8f40f08a6712e2fd27220ff14ad.tar.gz opie-64888e9cd2f4c8f40f08a6712e2fd27220ff14ad.tar.bz2 |
re-add missing diskspace function
-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 @@ -12,18 +12,18 @@ #define DEVELOPERS_VERSION #define QTOPIA_INTERNAL_FSLP // to get access to fileproperties #include "advancedfm.h" #include "inputDialog.h" #include "filePermissions.h" #include "output.h" -#include <opie/ofileselector.h> -#include <opie/ofiledialog.h> +// #include <opie/ofileselector.h> +// #include <opie/ofiledialog.h> #include <qpe/lnkproperties.h> #include <qpe/filemanager.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpemenubar.h> #include <qpe/qpetoolbar.h> #include <qpe/qpeapplication.h> @@ -1727,18 +1727,31 @@ QString AdvancedFm::getFileSystemType(const QString ¤tText) { if(path.isEmpty()) baseFs = temp.right( temp.length() - temp.find("::",0,TRUE) - 2); if( current.find( path,0,TRUE) != -1 && !path.isEmpty()) { return temp.right( temp.length() - temp.find("::",0,TRUE) - 2); } } return baseFs; } -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 ""; } void AdvancedFm::doBeam() { Ir ir; if(!ir.supported()){ } else { QStringList curFileList = getPath(); @@ -1863,17 +1876,16 @@ void AdvancedFm::showFileMenu() { void AdvancedFm::cancelMenuTimer() { qDebug("selectionChanged: cancel menu timer"); if( menuTimer.isActive() ) menuTimer.stop(); } QString AdvancedFm::checkDiskSpace(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; 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 @@ -2,17 +2,17 @@ TEMPLATE = app CONFIG += qt warn_on release HEADERS = advancedfm.h inputDialog.h filePermissions.h output.h SOURCES = advancedfm.cpp inputDialog.cpp filePermissions.cpp output.cpp main.cpp TARGET = advancedfm REQUIRES=medium-config INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include DESTDIR = $(OPIEDIR)/bin -LIBS += -lqpe -lopie +LIBS += -lqpe TRANSLATIONS = ../../../i18n/de/advancedfm.ts \ ../../../i18n/en/advancedfm.ts \ ../../../i18n/es/advancedfm.ts \ ../../../i18n/fr/advancedfm.ts \ ../../../i18n/hu/advancedfm.ts \ ../../../i18n/ja/advancedfm.ts \ ../../../i18n/ko/advancedfm.ts \ |