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
@@ -8,26 +8,26 @@
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#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>
#include <qpe/resource.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/config.h>
#include <qpe/mimetype.h>
@@ -1723,26 +1723,39 @@ QString AdvancedFm::getFileSystemType(const QString &currentText) {
for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) {
QString temp = (*it);
QString path = temp.left(temp.find("::",0,TRUE) );
path = path.right( path.length()-1);
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();
if( curFileList.count() > 0) {
if (TabWidget->currentPageIndex() == 0) {
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
@@ -1859,25 +1872,24 @@ void AdvancedFm::showFileMenu() {
if(m) delete m;
}
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;
if ( !mult ) mult = 1;
if ( !div ) div = 1;
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
@@ -1,25 +1,25 @@
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 \
- ../../../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