-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 25 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 2 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 15 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 13 |
4 files changed, 51 insertions, 4 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 6b7fa1f..60558e7 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -902,11 +902,34 @@ void AdvancedFm::gotoDirectory(const QString &file) { QString curDir = file; QDir *thisDir = CurrentDir(); - if(QDir( curDir).exists() ) { thisDir->setPath( curDir ); chdir( curDir.latin1() ); thisDir->cd( curDir, TRUE); populateView(); } + else if(QFileInfo(curDir).exists()) { + QFileInfo fileInfo(curDir); + curDir=fileInfo.dirPath(); + if(QDir( curDir).exists() ) { + thisDir->setPath( curDir ); + chdir( curDir.latin1() ); + thisDir->cd( curDir, TRUE); + populateView(); + } + findFile(file); + } + +} + +void AdvancedFm::findFile(const QString &fileName) { + QFileInfo fi(fileName); + QListView *thisView = CurrentView(); + QListViewItemIterator it( thisView ); + for ( ; it.current(); ++it ) { + if(it.current()->text(0) == fi.fileName()) { + it.current()->setSelected(true); + thisView->ensureItemVisible(it.current()); + } + } } diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index c9a5525..94d7bd7 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h @@ -165,6 +165,8 @@ private: void addCustomDir(); void removeCustomDir(); void gotoDirectory(const QString &); + void openSearch(); + void findFile(const QString &); private slots: void processEnded(OProcess *); diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index d0de442..a120f35 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp @@ -12,6 +12,8 @@ #include "advancedfm.h" #include <opie/otabwidget.h> +#include <qpe/storage.h> + #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qpe/menubutton.h> @@ -83,6 +85,8 @@ void AdvancedFm::init() { fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); fileMenu->insertSeparator(); + fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); + fileMenu->insertSeparator(); fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); @@ -198,6 +202,7 @@ void AdvancedFm::init() { /////////////// + struct utsname name; /* check for embedix kernel running on the zaurus*/ if (uname(&name) != -1) { QString release=name.release; @@ -205,10 +210,17 @@ void AdvancedFm::init() { zaurusDevice=TRUE; } else { zaurusDevice=FALSE; - sdButton->hide(); } } + if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { + qDebug("not have sd"); + sdButton->hide(); + } + if( !StorageInfo::hasCf() ) { + qDebug("not have cf"); + cfButton->hide(); + } currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); currentDir.setPath( QDir::currentDirPath()); @@ -248,6 +260,7 @@ void AdvancedFm::initConnections() connect( Local_View, SIGNAL( clicked( QListViewItem*)), this,SLOT( ListClicked(QListViewItem *)) ); + connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 575833a..2201960 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp @@ -203,7 +203,7 @@ void AdvancedFm::doDelete() if(f.right(1).find("/",0,TRUE) == -1) f += "/"; f += myFile; - if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) + if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) //if file is a directory { switch ( QMessageBox::warning( this, tr("Delete Directory?"), tr("Really delete\n") + f + "\nand all it's contents ?" @@ -233,11 +233,16 @@ void AdvancedFm::doDelete() } QString cmd="rm "+f; QFile file(f); - if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) + if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) { + qDebug("remove link files "+f); +// AppLnk lnk(f); +// qDebug(lnk.linkFile()); +// lnk.removeLinkFile(); file.remove(); } } } + } populateView(); } @@ -885,3 +890,7 @@ void AdvancedFm::okRename() delete view->currentItem(); populateView(); } + +void AdvancedFm::openSearch() { + +} |