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 | |||
@@ -902,11 +902,34 @@ 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 | } |