-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 41 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.h | 1 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 2 |
3 files changed, 7 insertions, 37 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index ec7a08a..f1be471 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -1,31 +1,34 @@ /*************************************************************************** AdvancedFm.cpp ------------------- ** Created: Sat Mar 9 23:33:09 2002 copyright : (C) 2002 by ljp email : ljp@llornkcor.com * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #define DEVELOPERS_VERSION #include "advancedfm.h" #include <opie2/odebug.h> + +#include <opie2/ostorageinfo.h> + #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <qpe/mimetype.h> #include <qpe/applnk.h> #include <qpe/resource.h> #include <qpe/menubutton.h> #include <qcombobox.h> #include <qpopupmenu.h> #include <qlistview.h> #include <qmessagebox.h> #include <qlineedit.h> #include <sys/stat.h> #include <time.h> @@ -197,50 +200,35 @@ void AdvancedFm::populateView() { item->setPixmap( 0,pm); } } closedir(dir); } thisView->setSorting( 3,FALSE); fillCombo( (const QString &) path ); } void AdvancedFm::rePopulate() { // qDebug("repopulate views"); populateView(); setOtherTabCurrent(); populateView(); - -// int tmpTab = whichTab; -// // odebug << "" << tmpTab << "" << oendl; - -// for(int i =1; i < 3; i++) { -// TabWidget->setCurrentWidget(i - 1); -// populateView(); -// } -// TabWidget->setCurrentWidget( tmpTab - 1); } void AdvancedFm::ListClicked(QListViewItem *selectedItem) { -// if ( TabWidget->currentWidget() == tab) -// qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked local"); -// else -// qDebug("XXXXXXXXXXXXXXXXXXXXXXXX ListClicked remote"); - - if(selectedItem) { QString strItem=selectedItem->text(0); // owarn << strItem << oendl; QString strSize=selectedItem->text(1); strSize=strSize.stripWhiteSpace(); bool isDirectory = false; QString strItem2; if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink strItem2 = dealWithSymName((const QString&)strItem); if(QDir(strItem2).exists() ) strItem = strItem2; } if( strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { @@ -264,33 +252,32 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in { if(renameBox != 0 ) { cancelRename(); } } break; // case 2: // menuTimer.start( 50, TRUE ); // break; }; } void AdvancedFm::refreshCurrentTab() { populateView(); // if ( TabWidget->currentWidget() == tab) { - } void AdvancedFm::switchToLocalTab() { TabWidget->setCurrentWidget(0); // Local_View->setFocus(); whichTab = 1; } void AdvancedFm::switchToRemoteTab() { TabWidget->setCurrentWidget(1); // Remote_View->setFocus(); whichTab = 2; } void AdvancedFm::currentPathComboChanged() { QString pDir = currentPathCombo->lineEdit()->text(); @@ -339,40 +326,39 @@ QStringList AdvancedFm::getPath() { 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() { - changeTo("/mnt/card");// this can change so fix + Opie::Core::OStorageInfo info; + changeTo(info.sdPath()); } void AdvancedFm::CFButtonPushed() { - if(zaurusDevice) - changeTo("/mnt/cf"); //zaurus - else - changeTo("/mnt/hda"); //ipaq + 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() ) @@ -757,42 +743,29 @@ void AdvancedFm::setOtherTabCurrent() { OtherView()->setSelected( CurrentView()->firstChild(), true); } void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { // odebug << "qcop message "+msg << oendl; QDataStream stream ( data, IO_ReadOnly ); if ( msg == "openDirectory(QString)" ) { // odebug << "received" << oendl; QString file; stream >> file; changeTo( (const QString &) file); } } void AdvancedFm::setDocument(const QString &file) { changeTo( 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()); - } - } -} - void AdvancedFm::slotSwitchMenu(int item) { Q_UNUSED(item); // qDebug( "Switch %d",item); // viewMenu->setItemChecked(item, true); } void AdvancedFm::navigateToSelected() { if( !CurrentView()->currentItem()) return; doDirChange(); } diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h index 6f7eb96..42f3bc6 100644 --- a/noncore/apps/advancedfm/advancedfm.h +++ b/noncore/apps/advancedfm/advancedfm.h @@ -164,29 +164,28 @@ protected slots: bool moveDirectory( const QString & , const QString & ); // void slotSwitchtoLocal(int); private: MenuButton *menuButton; QString oldName, localViewDir, remoteViewDir; void startProcess(const QString &); bool eventFilter( QObject * , QEvent * ); void cancelRename(); void doRename(QListView *); void okRename(); void customDirsToMenu(); void addCustomDir(); void removeCustomDir(); void navigateToSelected(); - void findFile(const QString &); private slots: void processEnded(Opie::Core::OProcess *); void oprocessStderr(Opie::Core::OProcess *, char *, int); void gotoCustomDir(const QString &); void qcopReceive(const QCString&, const QByteArray&); void setDocument(const QString &); // void doMenu(int }; #endif // ADVANCEDFM_H diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 1047c5a..9be0ceb 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp @@ -43,34 +43,32 @@ void AdvancedFm::init() { QMenuBar *menuBar = new QMenuBar(this); menuBar->setMargin( 0 ); // squeeze fileMenu = new QPopupMenu( this ); viewMenu = new QPopupMenu( this ); // customDirMenu = new QPopupMenu( this ); layout->addWidget( menuBar ); menuBar->insertItem( tr( "File" ), fileMenu); menuBar->insertItem( tr( "View" ), viewMenu); cdUpButton = new QToolButton( 0,"cdUpButton"); cdUpButton->setPixmap(Resource::loadPixmap("up")); cdUpButton->setAutoRaise( true ); menuBar->insertItem( cdUpButton ); - - qpeDirButton= new QToolButton( 0,"QPEButton"); qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); qpeDirButton->setAutoRaise( true ); menuBar->insertItem( qpeDirButton ); cfButton = new QToolButton( 0, "CFButton"); cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); cfButton->setAutoRaise( true ); menuBar->insertItem( cfButton ); sdButton = new QToolButton( 0, "SDButton"); sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); sdButton->setAutoRaise( true ); menuBar->insertItem( sdButton ); docButton = new QToolButton( 0,"docsButton"); |