-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 27 | ||||
-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 | 17 |
4 files changed, 54 insertions, 7 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 @@ -903,6 +903,5 @@ void AdvancedFm::gotoDirectory(const QString &file) { QString curDir = file; QDir *thisDir = CurrentDir(); - - if(QDir( curDir).exists() ) { + if(QDir( curDir).exists() ) { thisDir->setPath( curDir ); chdir( curDir.latin1() ); @@ -910,3 +909,27 @@ void AdvancedFm::gotoDirectory(const QString &file) { 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 @@ -166,4 +166,6 @@ private: void removeCustomDir(); void gotoDirectory(const QString &); + void openSearch(); + void findFile(const QString &); private slots: 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 @@ -13,4 +13,6 @@ #include <opie/otabwidget.h> +#include <qpe/storage.h> + #include <qpe/qpeapplication.h> #include <qpe/resource.h> @@ -84,4 +86,6 @@ void AdvancedFm::init() { 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() )); @@ -199,4 +203,5 @@ void AdvancedFm::init() { /////////////// + struct utsname name; /* check for embedix kernel running on the zaurus*/ if (uname(&name) != -1) { @@ -206,8 +211,15 @@ void AdvancedFm::init() { } 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()); @@ -249,4 +261,5 @@ 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 @@ -4,5 +4,5 @@ ** Created: Sat Mar 9 23:33:09 2002 copyright : (C) 2002 by ljp - email : ljp@llornkcor.com + email : ljp@llornkcor.com * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -204,5 +204,5 @@ void AdvancedFm::doDelete() 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 + @@ -234,6 +234,11 @@ void AdvancedFm::doDelete() QString cmd="rm "+f; QFile file(f); - if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) - file.remove(); + if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) { + qDebug("remove link files "+f); +// AppLnk lnk(f); +// qDebug(lnk.linkFile()); +// lnk.removeLinkFile(); + file.remove(); + } } } @@ -886,2 +891,6 @@ void AdvancedFm::okRename() populateView(); } + +void AdvancedFm::openSearch() { + +} |