summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-05-12 14:52:31 (UTC)
committer llornkcor <llornkcor>2003-05-12 14:52:31 (UTC)
commit8a87ca1f7de6a205b47986db8ad4a082f39b9c34 (patch) (side-by-side diff)
treec7f80978a8f53c3faefa6bfc1a626bafcf8837a4
parentca02db5ebfc5e44c3b216c12757683bac246ba23 (diff)
downloadopie-8a87ca1f7de6a205b47986db8ad4a082f39b9c34.zip
opie-8a87ca1f7de6a205b47986db8ad4a082f39b9c34.tar.gz
opie-8a87ca1f7de6a205b47986db8ad4a082f39b9c34.tar.bz2
show file selected if setDoc/openDir qcop is file
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp27
-rw-r--r--noncore/apps/advancedfm/advancedfm.h2
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp15
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp17
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
@@ -904,4 +904,3 @@ void AdvancedFm::gotoDirectory(const QString &file) {
QDir *thisDir = CurrentDir();
-
- if(QDir( curDir).exists() ) {
+ if(QDir( curDir).exists() ) {
thisDir->setPath( curDir );
@@ -911,2 +910,26 @@ void AdvancedFm::gotoDirectory(const QString &file) {
}
+ 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
@@ -167,2 +167,4 @@ private:
void gotoDirectory(const QString &);
+ void openSearch();
+ void findFile(const QString &);
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
@@ -14,2 +14,4 @@
#include <opie/otabwidget.h>
+#include <qpe/storage.h>
+
#include <qpe/qpeapplication.h>
@@ -85,2 +87,4 @@ void AdvancedFm::init() {
fileMenu->insertSeparator();
+ fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() ));
+ fileMenu->insertSeparator();
fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() ));
@@ -200,2 +204,3 @@ void AdvancedFm::init() {
+
struct utsname name; /* check for embedix kernel running on the zaurus*/
@@ -207,3 +212,2 @@ void AdvancedFm::init() {
zaurusDevice=FALSE;
- sdButton->hide();
}
@@ -211,2 +215,10 @@ void AdvancedFm::init() {
+ 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);
@@ -250,2 +262,3 @@ void AdvancedFm::initConnections()
this,SLOT( ListClicked(QListViewItem *)) );
+
connect( Local_View, SIGNAL( mouseButtonPressed( 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
@@ -5,3 +5,3 @@
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 *
@@ -205,3 +205,3 @@ void AdvancedFm::doDelete()
f += myFile;
- if(QDir(f).exists() && !QFileInfo(f).isSymLink() )
+ if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) //if file is a directory
{
@@ -235,4 +235,9 @@ void AdvancedFm::doDelete()
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();
+ }
}
@@ -887 +892,5 @@ void AdvancedFm::okRename()
}
+
+void AdvancedFm::openSearch() {
+
+}