-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 52 | ||||
-rw-r--r-- | noncore/net/opieftp/opieftp.h | 9 |
2 files changed, 36 insertions, 25 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 37e2134..fd6b028 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp @@ -22,4 +22,5 @@ #include <qpe/qcopenvelope_qws.h> #include <qpe/config.h> +#include <qpe/mimetype.h> #include <qstringlist.h> @@ -203,4 +204,5 @@ OpieFtp::OpieFtp( ) tabLayout_3->addMultiCellWidget( TextLabel5, 2, 2, 2, 3 ); + remotePath = new QLineEdit( "/", tab_3, "remotePath" ); tabLayout_3->addMultiCellWidget( remotePath, 3, 3, 2, 3 ); @@ -226,5 +228,4 @@ OpieFtp::OpieFtp( ) connect(connectServerBtn,SIGNAL( toggled( bool)),SLOT( connectorBtnToggled(bool) )); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); tabLayout_3->addItem( spacer, 5, 0 ); @@ -241,9 +242,9 @@ OpieFtp::OpieFtp( ) currentPathCombo = new QComboBox( FALSE, this, "currentPathCombo" ); layout->addMultiCellWidget( currentPathCombo, 3, 3, 0, 3 ); - + currentPathCombo->setEditable(TRUE); currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); connect( currentPathCombo, SIGNAL( activated( const QString & ) ), - this, SLOT( currentPathComboChanged()currentPathCombo( const QString & ) ) ); + this, SLOT( currentPathComboActivated( const QString & ) ) ); connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), @@ -266,4 +267,5 @@ OpieFtp::OpieFtp( ) PasswordEdit->setText( tr( "" ) ); #endif + filterStr="*"; b=FALSE; @@ -327,5 +329,5 @@ void OpieFtp::serverComboEdited(const QString & edit) { if( !edit.isEmpty() ) { currentServerConfig = -1; - qDebug("comboedited"); +// qDebug("comboedited"); } } @@ -551,22 +553,28 @@ void OpieFtp::populateLocalView() } } - if(fileL !="./") { - item= new QListViewItem( ListView,fileL,fileS , fileDate); + if(fileL !="./" && fi->exists()) { + item= new QListViewItem( Local_View,fileL,fileS , fileDate); QPixmap pm; - pm= Resource::loadPixmap( "folder" ); if(isDir || fileL.find("/",0,TRUE) != -1) { if( !QDir( fi->filePath() ).isReadable()) pm = Resource::loadPixmap( "lockedfolder" ); + else + pm= Resource::loadPixmap( "folder" ); item->setPixmap( 0,pm ); } else { if( !fi->isReadable() ) pm = Resource::loadPixmap( "locked" ); - else - pm = Resource::loadPixmap( "fileopen" ); + else { + MimeType mt(fi->filePath()); + pm=mt.pixmap(); + if(pm.isNull()) + pm = Resource::loadPixmap( "UnknownDocument-14" ); item->setPixmap( 0,pm); } + } if( fileL.find("->",0,TRUE) != -1) { // overlay link image + pm= Resource::loadPixmap( "folder" ); QPixmap lnk = Resource::loadPixmap( "symlink" ); QPainter painter( &pm ); @@ -641,4 +649,5 @@ bool OpieFtp::populateRemoteView( ) void OpieFtp::remoteListClicked(QListViewItem *selectedItem) { + if(item) { QCopEnvelope ( "QPE/System", "busy()" ); QString oldRemoteCurrentDir = currentRemoteDir; @@ -693,7 +702,9 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) QCopEnvelope ( "QPE/System", "notBusy()" ); } +} void OpieFtp::localListClicked(QListViewItem *selectedItem) { + if(item) { QString strItem=selectedItem->text(0); QString strSize=selectedItem->text(1); @@ -729,4 +740,5 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) } } +} void OpieFtp::doLocalCd() @@ -965,5 +977,5 @@ void OpieFtp::currentPathComboActivated(const QString & currentPath) { chdir( currentPath.latin1() ); currentDir.cd( currentPath, TRUE); - populateLocalList(); + populateLocalView(); update(); } else { @@ -978,15 +990,15 @@ void OpieFtp::currentPathComboActivated(const QString & currentPath) { void OpieFtp::fillCombo(const QString ¤tPath) { - currentPathComboBox->lineEdit()->setText(currentPath); + currentPathCombo->lineEdit()->setText(currentPath); if( localDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { - currentPathComboBox->clear(); + currentPathCombo->clear(); localDirPathStringList.prepend(currentPath ); - currentPathComboBox->insertStringList( localDirPathStringList,-1); + currentPathCombo->insertStringList( localDirPathStringList,-1); } - currentPathComboBox->lineEdit()->setText(currentPath); + currentPathCombo->lineEdit()->setText(currentPath); if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { - currentPathComboBox->clear(); + currentPathCombo->clear(); remoteDirPathStringList.prepend(currentPath ); - currentPathComboBox->insertStringList( remoteDirPathStringList,-1); + currentPathCombo->insertStringList( remoteDirPathStringList,-1); } } @@ -994,9 +1006,9 @@ void OpieFtp::fillCombo(const QString ¤tPath) { void OpieFtp::fillRemoteCombo(const QString ¤tPath) { - dirPathCombo->lineEdit()->setText(currentPath); + currentPathCombo->lineEdit()->setText(currentPath); if( remoteDirPathStringList.grep(currentPath,TRUE).isEmpty() ) { - dirPathCombo->clear(); + currentPathCombo->clear(); remoteDirPathStringList.prepend(currentPath ); - dirPathCombo->insertStringList( remoteDirPathStringList,-1); + currentPathCombo->insertStringList( remoteDirPathStringList,-1); } } @@ -1128,5 +1140,5 @@ void OpieFtp::serverComboSelected(int index) remoteServerStr = cfg.readEntry( temp,""); cfg.setGroup(temp); - qDebug(temp); +// qDebug(temp); int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); port = remoteServerStr.right( divider - 1); diff --git a/noncore/net/opieftp/opieftp.h b/noncore/net/opieftp/opieftp.h index 57599b7..32862c7 100644 --- a/noncore/net/opieftp/opieftp.h +++ b/noncore/net/opieftp/opieftp.h @@ -53,5 +53,5 @@ public: QComboBox *UsernameComboBox, *ServerComboBox, *currentPathCombo; - QLineEdit *PasswordEdit, *remotePath, *currentPathEdit; + QLineEdit *PasswordEdit, *remotePath; QLabel *TextLabel2, *TextLabel1, *TextLabel3, *TextLabel4;; QSpinBox* PortSpinBox; @@ -95,12 +95,11 @@ protected slots: void localRename(); void currentPathComboChanged(); - void fillCombos(); - void fillCombo(const QString &); void currentPathComboActivated(const QString &); void switchToLocalTab(); void switchToRemoteTab(); void switchToConfigTab(); - void fillCombo(); - void fillRemoteCombo(); + void fillCombos(); + void fillRemoteCombo(const QString&); + void fillCombo(const QString &); void serverComboSelected(int); void deleteServer(); |