summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-08-06 13:59:45 (UTC)
committer llornkcor <llornkcor>2002-08-06 13:59:45 (UTC)
commit64888e9cd2f4c8f40f08a6712e2fd27220ff14ad (patch) (side-by-side diff)
tree862bcda0849bf79b3eeb6fbab1ef18d08b005dc9
parentb980135ff5ce5447ca41411b6ace74ce2803fadb (diff)
downloadopie-64888e9cd2f4c8f40f08a6712e2fd27220ff14ad.zip
opie-64888e9cd2f4c8f40f08a6712e2fd27220ff14ad.tar.gz
opie-64888e9cd2f4c8f40f08a6712e2fd27220ff14ad.tar.bz2
re-add missing diskspace function
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp22
-rw-r--r--noncore/apps/advancedfm/advancedfm.pro28
2 files changed, 31 insertions, 19 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
@@ -17,8 +17,8 @@
#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>
@@ -1732,8 +1732,21 @@ QString AdvancedFm::getFileSystemType(const QString &currentText) {
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() {
@@ -1868,7 +1881,6 @@ void AdvancedFm::cancelMenuTimer() {
}
QString AdvancedFm::checkDiskSpace(const QString &path) {
-
struct statfs fss;
if ( !statfs( path.latin1(), &fss ) ) {
int blkSize = fss.f_bsize;
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
@@ -7,19 +7,19 @@ 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 \
- ../../../i18n/no/advancedfm.ts \
- ../../../i18n/pl/advancedfm.ts \
- ../../../i18n/pt/advancedfm.ts \
- ../../../i18n/pt_BR/advancedfm.ts \
- ../../../i18n/sl/advancedfm.ts \
- ../../../i18n/zh_CN/advancedfm.ts \
- ../../../i18n/zh_TW/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 \
+ ../../../i18n/no/advancedfm.ts \
+ ../../../i18n/pl/advancedfm.ts \
+ ../../../i18n/pt/advancedfm.ts \
+ ../../../i18n/pt_BR/advancedfm.ts \
+ ../../../i18n/sl/advancedfm.ts \
+ ../../../i18n/zh_CN/advancedfm.ts \
+ ../../../i18n/zh_TW/advancedfm.ts