author | llornkcor <llornkcor> | 2003-05-12 14:52:31 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-05-12 14:52:31 (UTC) |
commit | 8a87ca1f7de6a205b47986db8ad4a082f39b9c34 (patch) (unidiff) | |
tree | c7f80978a8f53c3faefa6bfc1a626bafcf8837a4 /noncore | |
parent | ca02db5ebfc5e44c3b216c12757683bac246ba23 (diff) | |
download | opie-8a87ca1f7de6a205b47986db8ad4a082f39b9c34.zip opie-8a87ca1f7de6a205b47986db8ad4a082f39b9c34.tar.gz opie-8a87ca1f7de6a205b47986db8ad4a082f39b9c34.tar.bz2 |
show file selected if setDoc/openDir qcop is file
-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) { | |||
903 | QString curDir = file; | 903 | QString curDir = file; |
904 | QDir *thisDir = CurrentDir(); | 904 | QDir *thisDir = CurrentDir(); |
905 | 905 | if(QDir( curDir).exists() ) { | |
906 | if(QDir( curDir).exists() ) { | ||
907 | thisDir->setPath( curDir ); | 906 | thisDir->setPath( curDir ); |
908 | chdir( curDir.latin1() ); | 907 | chdir( curDir.latin1() ); |
@@ -910,3 +909,27 @@ void AdvancedFm::gotoDirectory(const QString &file) { | |||
910 | populateView(); | 909 | populateView(); |
911 | } | 910 | } |
911 | else if(QFileInfo(curDir).exists()) { | ||
912 | QFileInfo fileInfo(curDir); | ||
913 | curDir=fileInfo.dirPath(); | ||
914 | if(QDir( curDir).exists() ) { | ||
915 | thisDir->setPath( curDir ); | ||
916 | chdir( curDir.latin1() ); | ||
917 | thisDir->cd( curDir, TRUE); | ||
918 | populateView(); | ||
919 | } | ||
920 | findFile(file); | ||
921 | } | ||
922 | |||
923 | } | ||
924 | |||
925 | void AdvancedFm::findFile(const QString &fileName) { | ||
926 | QFileInfo fi(fileName); | ||
927 | QListView *thisView = CurrentView(); | ||
928 | QListViewItemIterator it( thisView ); | ||
929 | for ( ; it.current(); ++it ) { | ||
930 | if(it.current()->text(0) == fi.fileName()) { | ||
931 | it.current()->setSelected(true); | ||
932 | thisView->ensureItemVisible(it.current()); | ||
933 | } | ||
934 | } | ||
912 | } | 935 | } |
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: | |||
166 | void removeCustomDir(); | 166 | void removeCustomDir(); |
167 | void gotoDirectory(const QString &); | 167 | void gotoDirectory(const QString &); |
168 | void openSearch(); | ||
169 | void findFile(const QString &); | ||
168 | 170 | ||
169 | private slots: | 171 | 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 @@ | |||
13 | 13 | ||
14 | #include <opie/otabwidget.h> | 14 | #include <opie/otabwidget.h> |
15 | #include <qpe/storage.h> | ||
16 | |||
15 | #include <qpe/qpeapplication.h> | 17 | #include <qpe/qpeapplication.h> |
16 | #include <qpe/resource.h> | 18 | #include <qpe/resource.h> |
@@ -84,4 +86,6 @@ void AdvancedFm::init() { | |||
84 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 86 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
85 | fileMenu->insertSeparator(); | 87 | fileMenu->insertSeparator(); |
88 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); | ||
89 | fileMenu->insertSeparator(); | ||
86 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | 90 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
87 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | 91 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
@@ -199,4 +203,5 @@ void AdvancedFm::init() { | |||
199 | /////////////// | 203 | /////////////// |
200 | 204 | ||
205 | |||
201 | struct utsname name; /* check for embedix kernel running on the zaurus*/ | 206 | struct utsname name; /* check for embedix kernel running on the zaurus*/ |
202 | if (uname(&name) != -1) { | 207 | if (uname(&name) != -1) { |
@@ -206,8 +211,15 @@ void AdvancedFm::init() { | |||
206 | } else { | 211 | } else { |
207 | zaurusDevice=FALSE; | 212 | zaurusDevice=FALSE; |
208 | sdButton->hide(); | ||
209 | } | 213 | } |
210 | } | 214 | } |
211 | 215 | ||
216 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { | ||
217 | qDebug("not have sd"); | ||
218 | sdButton->hide(); | ||
219 | } | ||
220 | if( !StorageInfo::hasCf() ) { | ||
221 | qDebug("not have cf"); | ||
222 | cfButton->hide(); | ||
223 | } | ||
212 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 224 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
213 | currentDir.setPath( QDir::currentDirPath()); | 225 | currentDir.setPath( QDir::currentDirPath()); |
@@ -249,4 +261,5 @@ void AdvancedFm::initConnections() | |||
249 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), | 261 | connect( Local_View, SIGNAL( clicked( QListViewItem*)), |
250 | this,SLOT( ListClicked(QListViewItem *)) ); | 262 | this,SLOT( ListClicked(QListViewItem *)) ); |
263 | |||
251 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 264 | connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
252 | this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); | 265 | 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 @@ | |||
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 * |
@@ -204,5 +204,5 @@ void AdvancedFm::doDelete() | |||
204 | f += "/"; | 204 | f += "/"; |
205 | f += myFile; | 205 | f += myFile; |
206 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) | 206 | if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) //if file is a directory |
207 | { | 207 | { |
208 | switch ( QMessageBox::warning( this, tr("Delete Directory?"), tr("Really delete\n") + f + | 208 | switch ( QMessageBox::warning( this, tr("Delete Directory?"), tr("Really delete\n") + f + |
@@ -234,6 +234,11 @@ void AdvancedFm::doDelete() | |||
234 | QString cmd="rm "+f; | 234 | QString cmd="rm "+f; |
235 | QFile file(f); | 235 | QFile file(f); |
236 | if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) | 236 | if(QFileInfo(myFile).fileName().find("../",0,TRUE)==-1) { |
237 | file.remove(); | 237 | qDebug("remove link files "+f); |
238 | // AppLnk lnk(f); | ||
239 | // qDebug(lnk.linkFile()); | ||
240 | // lnk.removeLinkFile(); | ||
241 | file.remove(); | ||
242 | } | ||
238 | } | 243 | } |
239 | } | 244 | } |
@@ -886,2 +891,6 @@ void AdvancedFm::okRename() | |||
886 | populateView(); | 891 | populateView(); |
887 | } | 892 | } |
893 | |||
894 | void AdvancedFm::openSearch() { | ||
895 | |||
896 | } | ||