summaryrefslogtreecommitdiff
path: root/noncore/apps
authorllornkcor <llornkcor>2004-09-25 08:22:22 (UTC)
committer llornkcor <llornkcor>2004-09-25 08:22:22 (UTC)
commitff6c55833c0cba33469f668ca158e96b409b4967 (patch) (unidiff)
tree63299a67e6f9bf1a06c8668775f95f96366efce0 /noncore/apps
parent946445e87ce74b8b28817ea63854054dbf165003 (diff)
downloadopie-ff6c55833c0cba33469f668ca158e96b409b4967.zip
opie-ff6c55833c0cba33469f668ca158e96b409b4967.tar.gz
opie-ff6c55833c0cba33469f668ca158e96b409b4967.tar.bz2
fix
Diffstat (limited to 'noncore/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp20
-rw-r--r--noncore/apps/advancedfm/advancedfm.h2
-rw-r--r--noncore/apps/advancedfm/advancedfm.pro2
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp5
4 files changed, 13 insertions, 16 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index f1be471..0dc822d 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -34,25 +34,25 @@
34#include <time.h> 34#include <time.h>
35#include <dirent.h> 35#include <dirent.h>
36#include <fcntl.h> 36#include <fcntl.h>
37#include <sys/vfs.h> 37#include <sys/vfs.h>
38#include <mntent.h> 38#include <mntent.h>
39 39
40using namespace Opie::Ui; 40using namespace Opie::Ui;
41 41
42AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) 42AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
43 : QMainWindow( ) { 43 : QMainWindow( ) {
44 init(); 44 init();
45 renameBox = 0; 45 renameBox = 0;
46 46 whichTab = 1;
47 unknownXpm = Resource::loadImage("UnknownDocument").smoothScale(AppLnk::smallIconSize(),AppLnk::smallIconSize() ); 47 unknownXpm = Resource::loadImage("UnknownDocument").smoothScale(AppLnk::smallIconSize(),AppLnk::smallIconSize() );
48 48
49 initConnections(); 49 initConnections();
50 rePopulate(); 50 rePopulate();
51 channel = new QCopChannel( "QPE/Application/advancedfm", this ); 51 channel = new QCopChannel( "QPE/Application/advancedfm", this );
52 connect(channel,SIGNAL(received(const QCString&,const QByteArray&)),this,SLOT(qcopReceive(const QCString&,const QByteArray&))); 52 connect(channel,SIGNAL(received(const QCString&,const QByteArray&)),this,SLOT(qcopReceive(const QCString&,const QByteArray&)));
53 switchToLocalTab(); 53 switchToLocalTab();
54} 54}
55 55
56AdvancedFm::~AdvancedFm() { 56AdvancedFm::~AdvancedFm() {
57} 57}
58 58
@@ -80,55 +80,53 @@ void AdvancedFm::tabChanged(QWidget *wd) {
80 } 80 }
81 qApp->processEvents(); 81 qApp->processEvents();
82 QString path = CurrentDir()->canonicalPath(); 82 QString path = CurrentDir()->canonicalPath();
83 // qDebug(path); 83 // qDebug(path);
84 if ( TabWidget->currentWidget() == tab) { 84 if ( TabWidget->currentWidget() == tab) {
85 viewMenu->setItemChecked(viewMenu->idAt(0), true); 85 viewMenu->setItemChecked(viewMenu->idAt(0), true);
86 viewMenu->setItemChecked(viewMenu->idAt(1), false); 86 viewMenu->setItemChecked(viewMenu->idAt(1), false);
87 } else { 87 } else {
88 viewMenu->setItemChecked(viewMenu->idAt(0), false); 88 viewMenu->setItemChecked(viewMenu->idAt(0), false);
89 viewMenu->setItemChecked(viewMenu->idAt(1), true); 89 viewMenu->setItemChecked(viewMenu->idAt(1), true);
90 } 90 }
91 91
92 QString fs= getFileSystemType( (const QString &) path);
93
94 setCaption(tr("AdvancedFm :: ")+fs+" :: "
95 +checkDiskSpace( (const QString &) path )+ tr(" kB free") );
96 chdir( path.latin1()); 92 chdir( path.latin1());
97 currentPathCombo->lineEdit()->setText(path); 93 currentPathCombo->lineEdit()->setText(path);
98} 94}
99 95
100 96
101void AdvancedFm::populateView() { 97void AdvancedFm::populateView() {
102 98
103 QPixmap pm; 99 QPixmap pm;
104 QListView *thisView = CurrentView(); 100 QListView *thisView = CurrentView();
105 QDir *thisDir = CurrentDir(); 101 QDir *thisDir = CurrentDir();
106 QString path = thisDir->canonicalPath(); 102 QString path = thisDir->canonicalPath();
107 103
108 thisView->clear(); 104 thisView->clear();
109 thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 105 thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
110 thisDir->setMatchAllDirs(TRUE); 106 thisDir->setMatchAllDirs(TRUE);
111 thisDir->setNameFilter(filterStr); 107 thisDir->setNameFilter(filterStr);
112 QString fileL, fileS, fileDate; 108 QString fileL, fileS, fileDate;
113 QString fs= getFileSystemType((const QString &) path); 109
110 QString fs = getFileSystemType((const QString &) path);
114 setCaption(tr("AdvancedFm :: ")+fs+" :: " 111 setCaption(tr("AdvancedFm :: ")+fs+" :: "
115 +checkDiskSpace((const QString &) path)+ tr(" kB free") ); 112 +checkDiskSpace((const QString &) path)+ tr(" kB free") );
116 bool isDir=FALSE; 113 bool isDir = FALSE;
114
117 const QFileInfoList *list = thisDir->entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/); 115 const QFileInfoList *list = thisDir->entryInfoList( /*QDir::All*/ /*, QDir::SortByMask*/);
118 QFileInfoListIterator it(*list); 116 QFileInfoListIterator it(*list);
119 QFileInfo *fi; 117 QFileInfo *fi;
120 while ( (fi=it.current()) ) { 118 while ( (fi=it.current()) ) {
121 if (fi->isSymLink() ) { 119 if (fi->isSymLink() ) {
122 QString symLink=fi->readLink(); 120 QString symLink = fi->readLink();
123 QFileInfo sym( symLink); 121 QFileInfo sym( symLink);
124 fileS.sprintf( "%10i", sym.size() ); 122 fileS.sprintf( "%10i", sym.size() );
125 fileL = fi->fileName() +" -> " + sym.filePath().data(); 123 fileL = fi->fileName() +" -> " + sym.filePath().data();
126 fileDate = sym.lastModified().toString(); 124 fileDate = sym.lastModified().toString();
127 } else { 125 } else {
128 fileS.sprintf( "%10i", fi->size() ); 126 fileS.sprintf( "%10i", fi->size() );
129 fileL = fi->fileName(); 127 fileL = fi->fileName();
130 fileDate= fi->lastModified().toString(); 128 fileDate= fi->lastModified().toString();
131 if( QDir(QDir::cleanDirPath( path +"/"+fileL)).exists() ) { 129 if( QDir(QDir::cleanDirPath( path +"/"+fileL)).exists() ) {
132// if(fileL == "..") 130// if(fileL == "..")
133 fileL += "/"; 131 fileL += "/";
134 isDir=TRUE; 132 isDir=TRUE;
@@ -314,47 +312,47 @@ QStringList AdvancedFm::getPath() {
314 QListView *thisView=CurrentView(); 312 QListView *thisView=CurrentView();
315 QList<QListViewItem> * getSelectedItems( QListView * thisView ); 313 QList<QListViewItem> * getSelectedItems( QListView * thisView );
316 QListViewItemIterator it( thisView ); 314 QListViewItemIterator it( thisView );
317 for ( ; it.current(); ++it ) { 315 for ( ; it.current(); ++it ) {
318 if ( it.current()->isSelected() ) { 316 if ( it.current()->isSelected() ) {
319 strList << it.current()->text(0); 317 strList << it.current()->text(0);
320// odebug << it.current()->text(0) << oendl; 318// odebug << it.current()->text(0) << oendl;
321 } 319 }
322 } 320 }
323 return strList; 321 return strList;
324} 322}
325 323
326void AdvancedFm::changeTo(const QString dir) { 324void AdvancedFm::changeTo(const QString &dir) {
327 chdir( dir.latin1()); 325 chdir( dir.latin1());
328 CurrentDir()->cd(dir, TRUE); 326 CurrentDir()->cd(dir, TRUE);
329 populateView(); 327 populateView();
330 update(); 328 update();
331} 329}
332 330
333void AdvancedFm::homeButtonPushed() { 331void AdvancedFm::homeButtonPushed() {
334 changeTo(QDir::homeDirPath()); 332 changeTo(QDir::homeDirPath());
335} 333}
336 334
337void AdvancedFm::docButtonPushed() { 335void AdvancedFm::docButtonPushed() {
338 changeTo(QPEApplication::documentDir()); 336 changeTo(QPEApplication::documentDir());
339} 337}
340 338
341void AdvancedFm::SDButtonPushed() { 339void AdvancedFm::SDButtonPushed() {
342 Opie::Core::OStorageInfo info; 340 Opie::Core::OStorageInfo info;
343 changeTo(info.sdPath()); 341 changeTo(info.sdPath());
344} 342}
345 343
346void AdvancedFm::CFButtonPushed() { 344void AdvancedFm::CFButtonPushed() {
347 Opie::Core::OStorageInfo info; 345 Opie::Core::OStorageInfo info;
348 changeTo(info.cfPath()); 346 changeTo(info.cfPath());
349} 347}
350 348
351void AdvancedFm::QPEButtonPushed() { 349void AdvancedFm::QPEButtonPushed() {
352 changeTo(QPEApplication::qpeDir()); 350 changeTo(QPEApplication::qpeDir());
353} 351}
354 352
355void AdvancedFm::doAbout() { 353void AdvancedFm::doAbout() {
356 QMessageBox::message("AdvancedFm",tr("<P>Advanced FileManager is copyright 2002-2003 by L.J.Potter<llornkcor@handhelds.org> and is licensed by the GPL</P>")); 354 QMessageBox::message("AdvancedFm",tr("<P>Advanced FileManager is copyright 2002-2003 by L.J.Potter<llornkcor@handhelds.org> and is licensed by the GPL</P>"));
357} 355}
358 356
359void AdvancedFm::keyPressEvent( QKeyEvent *e) { 357void AdvancedFm::keyPressEvent( QKeyEvent *e) {
360 Q_UNUSED(e); 358 Q_UNUSED(e);
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index c25bce2..a4f2510 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -87,30 +87,30 @@ protected:
87 void keyReleaseEvent( QKeyEvent *); 87 void keyReleaseEvent( QKeyEvent *);
88 void keyPressEvent( QKeyEvent *); 88 void keyPressEvent( QKeyEvent *);
89 QString getFileSystemType(const QString &); 89 QString getFileSystemType(const QString &);
90 QString getDiskSpace(const QString &); 90 QString getDiskSpace(const QString &);
91 void parsetab(const QString &fileName); 91 void parsetab(const QString &fileName);
92 QString checkDiskSpace(const QString &); 92 QString checkDiskSpace(const QString &);
93 QString dealWithSymName(const QString &); 93 QString dealWithSymName(const QString &);
94 QDir *CurrentDir(); 94 QDir *CurrentDir();
95 QDir *OtherDir(); 95 QDir *OtherDir();
96 QListView *CurrentView(); 96 QListView *CurrentView();
97 QListView *OtherView(); 97 QListView *OtherView();
98 void setOtherTabCurrent(); 98 void setOtherTabCurrent();
99 void changeTo(const QString dir);
100 99
101//protected signals: 100//protected signals:
102 // void newPath(QString); 101 // void newPath(QString);
103 102
104protected slots: 103protected slots:
104 void changeTo(const QString &);
105 void slotSwitchMenu(int); 105 void slotSwitchMenu(int);
106 void selectAll(); 106 void selectAll();
107 void addToDocs(); 107 void addToDocs();
108 void doDirChange(); 108 void doDirChange();
109 void mkDir(); 109 void mkDir();
110 void del(); 110 void del();
111 void rn(); 111 void rn();
112 void populateView(); 112 void populateView();
113 void rePopulate(); 113 void rePopulate();
114 void showHidden(); 114 void showHidden();
115 void showMenuHidden(); 115 void showMenuHidden();
116 void ListClicked(QListViewItem *); 116 void ListClicked(QListViewItem *);
diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro
index 713f61c..01ea8f4 100644
--- a/noncore/apps/advancedfm/advancedfm.pro
+++ b/noncore/apps/advancedfm/advancedfm.pro
@@ -1,14 +1,14 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG += qte warn_on quick-app 2CONFIG += qte warn_on quick-app debug
3HEADERS = advancedfm.h filePermissions.h output.h 3HEADERS = advancedfm.h filePermissions.h output.h
4SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp 4SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp
5TARGET = advancedfm 5TARGET = advancedfm
6INCLUDEPATH += $(OPIEDIR)/include 6INCLUDEPATH += $(OPIEDIR)/include
7DEPENDPATH += $(OPIEDIR)/include 7DEPENDPATH += $(OPIEDIR)/include
8LIBS += -lqpe -lqte -lopiecore2 -lopieui2 8LIBS += -lqpe -lqte -lopiecore2 -lopieui2
9 9
10!contains(CONFIG,quick-app) { 10!contains(CONFIG,quick-app) {
11 DESTDIR = $(OPIEDIR)/bin 11 DESTDIR = $(OPIEDIR)/bin
12 DEFINES += NOQUICKLAUNCH 12 DEFINES += NOQUICKLAUNCH
13} 13}
14 14
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 7b3dcf6..171e7c4 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -707,27 +707,26 @@ void AdvancedFm::fileBeamFinished( Ir *) {
707} 707}
708 708
709void AdvancedFm::selectAll() { 709void AdvancedFm::selectAll() {
710 QListView *thisView = CurrentView(); 710 QListView *thisView = CurrentView();
711 thisView->selectAll(true); 711 thisView->selectAll(true);
712 thisView->setSelected( thisView->firstChild(),false); 712 thisView->setSelected( thisView->firstChild(),false);
713} 713}
714 714
715void AdvancedFm::startProcess(const QString & cmd) { 715void AdvancedFm::startProcess(const QString & cmd) {
716 QStringList command; 716 QStringList command;
717 OProcess *process; 717 OProcess *process;
718 process = new OProcess(); 718 process = new OProcess();
719 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), this, SLOT( processEnded(Opie::Core::OProcess*))); 719 connect(process,SIGNAL(processExited(Opie::Core::OProcess*)),this,SLOT(processEnded(Opie::Core::OProcess*)));
720 720 connect(process,SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),this,SLOT(oprocessStderr(Opie::Core::OProcess*,char*,int)));
721 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int)));
722 721
723 command << "/bin/sh"; 722 command << "/bin/sh";
724 command << "-c"; 723 command << "-c";
725 command << cmd.latin1(); 724 command << cmd.latin1();
726 *process << command; 725 *process << command;
727 if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) 726 if(!process->start(OProcess::NotifyOnExit, OProcess::All) )
728 odebug << "could not start process" << oendl; 727 odebug << "could not start process" << oendl;
729} 728}
730 729
731void AdvancedFm::processEnded(OProcess *) { 730void AdvancedFm::processEnded(OProcess *) {
732 rePopulate(); 731 rePopulate();
733} 732}