author | llornkcor <llornkcor> | 2005-03-24 20:14:38 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2005-03-24 20:14:38 (UTC) |
commit | 1e6c3181dcc7ec4edbe99db0d886ce7a9c483056 (patch) (side-by-side diff) | |
tree | 38e98006c0bb49bb6b1008dddb840e961bb2b775 | |
parent | 38ace7e9b3c9665336c0e6d2350895b147858f1f (diff) | |
download | opie-1e6c3181dcc7ec4edbe99db0d886ce7a9c483056.zip opie-1e6c3181dcc7ec4edbe99db0d886ce7a9c483056.tar.gz opie-1e6c3181dcc7ec4edbe99db0d886ce7a9c483056.tar.bz2 |
cd to sd or mmc
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index fd81313..979549d 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -273,130 +273,135 @@ void AdvancedFm::switchToRemoteTab() { // whichTab = 2; } void AdvancedFm::currentPathComboChanged() { QString pDir = currentPathCombo->lineEdit()->text(); if(QDir(pDir).exists()) { CurrentDir()->setPath(pDir ); populateView(); } else { QMessageBox::message(tr("Note"),tr("<p>%1 does not exist</p>").arg(pDir)); } } void AdvancedFm::fillCombo(const QString ¤tPath) { if ( TabWidget->currentWidget() == tab) { // if ( whichTab == 1) { currentPathCombo->lineEdit()->setText( currentPath); if( localDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { currentPathCombo->clear(); localDirPathStringList.prepend( currentPath ); currentPathCombo->insertStringList( localDirPathStringList,-1); } } else { currentPathCombo->lineEdit()->setText( currentPath); if( remoteDirPathStringList.grep( currentPath,TRUE).isEmpty() ) { currentPathCombo->clear(); remoteDirPathStringList.prepend( currentPath ); currentPathCombo->insertStringList( remoteDirPathStringList,-1); } } } QStringList AdvancedFm::getPath() { QStringList strList; QListView *thisView=CurrentView(); QList<QListViewItem> * getSelectedItems( QListView * thisView ); QListViewItemIterator it( thisView ); for ( ; it.current(); ++it ) { if ( it.current()->isSelected() ) { strList << it.current()->text(0); // odebug << it.current()->text(0) << oendl; } } return strList; } void AdvancedFm::changeTo(const QString &dir) { chdir( dir.latin1()); CurrentDir()->cd(dir, TRUE); populateView(); update(); } void AdvancedFm::homeButtonPushed() { changeTo(QDir::homeDirPath()); } void AdvancedFm::docButtonPushed() { changeTo(QPEApplication::documentDir()); } void AdvancedFm::SDButtonPushed() { Opie::Core::OStorageInfo info; + if(StorageInfo::hasSd() ) { changeTo(info.sdPath()); } + else if(StorageInfo::hasMmc()) { + changeTo(info.mmcPath()); + } +} void AdvancedFm::CFButtonPushed() { Opie::Core::OStorageInfo info; changeTo(info.cfPath()); } void AdvancedFm::QPEButtonPushed() { changeTo(QPEApplication::qpeDir()); } void AdvancedFm::doAbout() { QMessageBox::message("AdvancedFm",tr("<P>Advanced FileManager is copyright 2002-2003 by L.J.Potter<llornkcor@handhelds.org> and is licensed by the GPL</P>")); } void AdvancedFm::keyPressEvent( QKeyEvent *e) { Q_UNUSED(e); } void AdvancedFm::keyReleaseEvent( QKeyEvent *e) { // if( CurrentView()->hasFocus() ) // e->ignore(); if( currentPathCombo->lineEdit()->hasFocus()) { // qDebug("shout!"); } else if( e->key() == Key_Left ) upDir(); else if( e->key() == Key_Return || e->key() == Key_Enter) navigateToSelected(); else if( e->key() == Key_Tab) setOtherTabCurrent(); else if( e->key() == Key_Delete ) del(); else e->accept(); } void AdvancedFm::parsetab(const QString &fileName) { fileSystemTypeList.clear(); fsList.clear(); struct mntent *me; FILE *mntfp = setmntent( fileName.latin1(), "r" ); if ( mntfp ) { while ( (me = getmntent( mntfp )) != 0 ) { QString deviceName = me->mnt_fsname; QString filesystemType = me->mnt_type; QString mountDir = me->mnt_dir; if(deviceName != "none") { if( fsList.contains(filesystemType) == 0 & filesystemType.find("proc",0,TRUE) == -1 & filesystemType.find("cramfs",0,TRUE) == -1 & filesystemType.find("auto",0,TRUE) == -1) fsList << filesystemType; fileSystemTypeList << mountDir+"::"+filesystemType; } } } endmntent( mntfp ); } |