summaryrefslogtreecommitdiff
Unidiff
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
@@ -1,45 +1,45 @@
1/*************************************************************************** 1/***************************************************************************
2 AdvancedFm.cpp 2 AdvancedFm.cpp
3 ------------------- 3 -------------------
4 ** Created: Sat Mar 9 23:33:09 2002 4 ** Created: Sat Mar 9 23:33:09 2002
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#define DEVELOPERS_VERSION 12#define DEVELOPERS_VERSION
13#define QTOPIA_INTERNAL_FSLP // to get access to fileproperties 13#define QTOPIA_INTERNAL_FSLP // to get access to fileproperties
14 14
15#include "advancedfm.h" 15#include "advancedfm.h"
16#include "inputDialog.h" 16#include "inputDialog.h"
17#include "filePermissions.h" 17#include "filePermissions.h"
18#include "output.h" 18#include "output.h"
19 19
20#include <opie/ofileselector.h> 20// #include <opie/ofileselector.h>
21#include <opie/ofiledialog.h> 21// #include <opie/ofiledialog.h>
22 22
23 23
24#include <qpe/lnkproperties.h> 24#include <qpe/lnkproperties.h>
25#include <qpe/filemanager.h> 25#include <qpe/filemanager.h>
26#include <qpe/qcopenvelope_qws.h> 26#include <qpe/qcopenvelope_qws.h>
27#include <qpe/qpemenubar.h> 27#include <qpe/qpemenubar.h>
28#include <qpe/qpetoolbar.h> 28#include <qpe/qpetoolbar.h>
29#include <qpe/qpeapplication.h> 29#include <qpe/qpeapplication.h>
30#include <qpe/resource.h> 30#include <qpe/resource.h>
31#include <qpe/qcopenvelope_qws.h> 31#include <qpe/qcopenvelope_qws.h>
32#include <qpe/config.h> 32#include <qpe/config.h>
33#include <qpe/mimetype.h> 33#include <qpe/mimetype.h>
34#include <qpe/applnk.h> 34#include <qpe/applnk.h>
35#include <qpe/ir.h> 35#include <qpe/ir.h>
36 36
37//#include <opie/ofileselector.h> 37//#include <opie/ofileselector.h>
38#include <qmultilineedit.h> 38#include <qmultilineedit.h>
39 39
40#include <qtextstream.h> 40#include <qtextstream.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qtoolbutton.h> 42#include <qtoolbutton.h>
43#include <qdatetime.h> 43#include <qdatetime.h>
44#include <qdir.h> 44#include <qdir.h>
45#include <qfile.h> 45#include <qfile.h>
@@ -1711,50 +1711,63 @@ void AdvancedFm::parsetab(const QString &fileName) {
1711 fsList << filesystemType; 1711 fsList << filesystemType;
1712 fileSystemTypeList << mountDir+"::"+filesystemType; 1712 fileSystemTypeList << mountDir+"::"+filesystemType;
1713 } 1713 }
1714 } 1714 }
1715 } 1715 }
1716 endmntent( mntfp ); 1716 endmntent( mntfp );
1717} 1717}
1718 1718
1719QString AdvancedFm::getFileSystemType(const QString &currentText) { 1719QString AdvancedFm::getFileSystemType(const QString &currentText) {
1720 parsetab("/etc/mtab"); //why did TT forget filesystem type? 1720 parsetab("/etc/mtab"); //why did TT forget filesystem type?
1721 QString current = currentText;//.right( currentText.length()-1); 1721 QString current = currentText;//.right( currentText.length()-1);
1722 QString baseFs; 1722 QString baseFs;
1723 for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) { 1723 for ( QStringList::Iterator it = fileSystemTypeList.begin(); it != fileSystemTypeList.end(); ++it ) {
1724 QString temp = (*it); 1724 QString temp = (*it);
1725 QString path = temp.left(temp.find("::",0,TRUE) ); 1725 QString path = temp.left(temp.find("::",0,TRUE) );
1726 path = path.right( path.length()-1); 1726 path = path.right( path.length()-1);
1727 if(path.isEmpty()) baseFs = temp.right( temp.length() - temp.find("::",0,TRUE) - 2); 1727 if(path.isEmpty()) baseFs = temp.right( temp.length() - temp.find("::",0,TRUE) - 2);
1728 if( current.find( path,0,TRUE) != -1 && !path.isEmpty()) { 1728 if( current.find( path,0,TRUE) != -1 && !path.isEmpty()) {
1729 return temp.right( temp.length() - temp.find("::",0,TRUE) - 2); 1729 return temp.right( temp.length() - temp.find("::",0,TRUE) - 2);
1730 } 1730 }
1731 } 1731 }
1732 return baseFs; 1732 return baseFs;
1733} 1733}
1734 1734
1735QString AdvancedFm::getDiskSpace( const QString &) { 1735QString AdvancedFm::getDiskSpace( const QString &path) {
1736 1736 struct statfs fss;
1737 if ( !statfs( path.latin1(), &fss ) ) {
1738 int blkSize = fss.f_bsize;
1739 // int totalBlks = fs.f_blocks;
1740 int availBlks = fss.f_bavail;
1741
1742 long mult = blkSize / 1024;
1743 long div = 1024 / blkSize;
1744 if ( !mult ) mult = 1;
1745 if ( !div ) div = 1;
1746
1747 return QString::number(availBlks * mult / div);
1748 }
1749 return "";
1737} 1750}
1738 1751
1739void AdvancedFm::doBeam() { 1752void AdvancedFm::doBeam() {
1740 Ir ir; 1753 Ir ir;
1741 if(!ir.supported()){ 1754 if(!ir.supported()){
1742 } else { 1755 } else {
1743 1756
1744 QStringList curFileList = getPath(); 1757 QStringList curFileList = getPath();
1745 if( curFileList.count() > 0) { 1758 if( curFileList.count() > 0) {
1746 1759
1747 if (TabWidget->currentPageIndex() == 0) { 1760 if (TabWidget->currentPageIndex() == 0) {
1748 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 1761 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
1749 1762
1750 QString curFile = currentDir.canonicalPath()+"/"+(*it); 1763 QString curFile = currentDir.canonicalPath()+"/"+(*it);
1751 if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); 1764 if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1);
1752 Ir *file = new Ir(this, "IR"); 1765 Ir *file = new Ir(this, "IR");
1753 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); 1766 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * )));
1754 file->send( curFile, curFile ); 1767 file->send( curFile, curFile );
1755 } 1768 }
1756 1769
1757 } else { 1770 } else {
1758 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 1771 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
1759 1772
1760 QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it); 1773 QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it);
@@ -1847,42 +1860,41 @@ void AdvancedFm::showFileMenu() {
1847 if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) //bad hack for Sharp zaurus failings 1860 if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) //bad hack for Sharp zaurus failings
1848 m->insertItem( tr( "Properties" ), this, SLOT( doProperties() )); 1861 m->insertItem( tr( "Properties" ), this, SLOT( doProperties() ));
1849 m->setCheckable(TRUE); 1862 m->setCheckable(TRUE);
1850 if (!b) 1863 if (!b)
1851 m->setItemChecked(m->idAt(0),TRUE); 1864 m->setItemChecked(m->idAt(0),TRUE);
1852 else 1865 else
1853 m->setItemChecked(m->idAt(0),FALSE); 1866 m->setItemChecked(m->idAt(0),FALSE);
1854 if(Ir::supported()) 1867 if(Ir::supported())
1855 m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() )); 1868 m->insertItem( tr( "Beam File" ), this, SLOT( doBeam() ));
1856 m->setFocus(); 1869 m->setFocus();
1857 m->exec( QCursor::pos() ); 1870 m->exec( QCursor::pos() );
1858 sleep(1); 1871 sleep(1);
1859 if(m) delete m; 1872 if(m) delete m;
1860} 1873}
1861 1874
1862 1875
1863void AdvancedFm::cancelMenuTimer() { 1876void AdvancedFm::cancelMenuTimer() {
1864 1877
1865 qDebug("selectionChanged: cancel menu timer"); 1878 qDebug("selectionChanged: cancel menu timer");
1866 if( menuTimer.isActive() ) 1879 if( menuTimer.isActive() )
1867 menuTimer.stop(); 1880 menuTimer.stop();
1868} 1881}
1869 1882
1870QString AdvancedFm::checkDiskSpace(const QString &path) { 1883QString AdvancedFm::checkDiskSpace(const QString &path) {
1871
1872 struct statfs fss; 1884 struct statfs fss;
1873 if ( !statfs( path.latin1(), &fss ) ) { 1885 if ( !statfs( path.latin1(), &fss ) ) {
1874 int blkSize = fss.f_bsize; 1886 int blkSize = fss.f_bsize;
1875// int totalBlks = fs.f_blocks; 1887// int totalBlks = fs.f_blocks;
1876 int availBlks = fss.f_bavail; 1888 int availBlks = fss.f_bavail;
1877 1889
1878 long mult = blkSize / 1024; 1890 long mult = blkSize / 1024;
1879 long div = 1024 / blkSize; 1891 long div = 1024 / blkSize;
1880 if ( !mult ) mult = 1; 1892 if ( !mult ) mult = 1;
1881 if ( !div ) div = 1; 1893 if ( !div ) div = 1;
1882 1894
1883 1895
1884 return QString::number(availBlks * mult / div); 1896 return QString::number(availBlks * mult / div);
1885 } 1897 }
1886 return ""; 1898 return "";
1887} 1899}
1888 1900
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 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3HEADERS = advancedfm.h inputDialog.h filePermissions.h output.h 3HEADERS = advancedfm.h inputDialog.h filePermissions.h output.h
4SOURCES = advancedfm.cpp inputDialog.cpp filePermissions.cpp output.cpp main.cpp 4SOURCES = advancedfm.cpp inputDialog.cpp filePermissions.cpp output.cpp main.cpp
5TARGET = advancedfm 5TARGET = advancedfm
6REQUIRES=medium-config 6REQUIRES=medium-config
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 8DEPENDPATH += $(OPIEDIR)/include
9DESTDIR = $(OPIEDIR)/bin 9DESTDIR = $(OPIEDIR)/bin
10LIBS += -lqpe -lopie 10LIBS += -lqpe
11 11
12TRANSLATIONS = ../../../i18n/de/advancedfm.ts \ 12TRANSLATIONS = ../../../i18n/de/advancedfm.ts \
13 ../../../i18n/en/advancedfm.ts \ 13 ../../../i18n/en/advancedfm.ts \
14 ../../../i18n/es/advancedfm.ts \ 14 ../../../i18n/es/advancedfm.ts \
15 ../../../i18n/fr/advancedfm.ts \ 15 ../../../i18n/fr/advancedfm.ts \
16 ../../../i18n/hu/advancedfm.ts \ 16 ../../../i18n/hu/advancedfm.ts \
17 ../../../i18n/ja/advancedfm.ts \ 17 ../../../i18n/ja/advancedfm.ts \
18 ../../../i18n/ko/advancedfm.ts \ 18 ../../../i18n/ko/advancedfm.ts \
19 ../../../i18n/no/advancedfm.ts \ 19 ../../../i18n/no/advancedfm.ts \
20 ../../../i18n/pl/advancedfm.ts \ 20 ../../../i18n/pl/advancedfm.ts \
21 ../../../i18n/pt/advancedfm.ts \ 21 ../../../i18n/pt/advancedfm.ts \
22 ../../../i18n/pt_BR/advancedfm.ts \ 22 ../../../i18n/pt_BR/advancedfm.ts \
23 ../../../i18n/sl/advancedfm.ts \ 23 ../../../i18n/sl/advancedfm.ts \
24 ../../../i18n/zh_CN/advancedfm.ts \ 24 ../../../i18n/zh_CN/advancedfm.ts \
25 ../../../i18n/zh_TW/advancedfm.ts 25 ../../../i18n/zh_TW/advancedfm.ts