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/apps/advancedfm/advancedfm.cpp | |
parent | ca02db5ebfc5e44c3b216c12757683bac246ba23 (diff) | |
download | opie-8a87ca1f7de6a205b47986db8ad4a082f39b9c34.zip opie-8a87ca1f7de6a205b47986db8ad4a082f39b9c34.tar.gz opie-8a87ca1f7de6a205b47986db8ad4a082f39b9c34.tar.bz2 |
show file selected if setDoc/openDir qcop is file
Diffstat (limited to 'noncore/apps/advancedfm/advancedfm.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 27 |
1 files changed, 25 insertions, 2 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 | |||
@@ -899,14 +899,37 @@ void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { | |||
899 | } | 899 | } |
900 | 900 | ||
901 | void AdvancedFm::gotoDirectory(const QString &file) { | 901 | void AdvancedFm::gotoDirectory(const QString &file) { |
902 | 902 | ||
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() ); |
909 | thisDir->cd( curDir, TRUE); | 908 | thisDir->cd( curDir, TRUE); |
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 | } |