author | llornkcor <llornkcor> | 2002-03-31 02:00:57 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-31 02:00:57 (UTC) |
commit | 13da5064c21e124f2202310ac4c54cb3ddc8c0b1 (patch) (side-by-side diff) | |
tree | d95a8c039a1240aace32be1751382ea43b8c77cc /noncore/net/opieftp | |
parent | 04158decf6fa76d966be178d07e1895336a47bd9 (diff) | |
download | opie-13da5064c21e124f2202310ac4c54cb3ddc8c0b1.zip opie-13da5064c21e124f2202310ac4c54cb3ddc8c0b1.tar.gz opie-13da5064c21e124f2202310ac4c54cb3ddc8c0b1.tar.bz2 |
fixed some goofy crap I thought I fixed earlier with server combo and multiple entries. oh well. Also fixed single click going into a repopulate(bad when remote)
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 3dda17e..e64fd73 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp @@ -130,13 +130,14 @@ OpieFtp::OpieFtp( ) Local_View->setColumnAlignment(1,QListView::AlignRight); Local_View->addColumn( tr("Date"),-1); Local_View->setColumnAlignment(2,QListView::AlignRight); Local_View->setAllColumnsShowFocus(TRUE); Local_View->setMultiSelection( TRUE ); Local_View->setSelectionMode(QListView::Extended); - QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); + + QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); tabLayout->addWidget( Local_View, 0, 0 ); connect( Local_View, SIGNAL( clicked( QListViewItem*)), this,SLOT( localListClicked(QListViewItem *)) ); // connect( Local_View, SIGNAL( doubleClicked( QListViewItem*)), @@ -315,13 +316,12 @@ void OpieFtp::newConnection() UsernameComboBox->lineEdit()->setText(""); PasswordEdit->setText( "" ); ServerComboBox->lineEdit()->setText( ""); remotePath->setText( currentRemoteDir = "/"); PortSpinBox->setValue( 21); TabWidget->setCurrentPage(2); - currentServerConfig = -1; } void OpieFtp::serverComboEdited(const QString & edit) { if( !edit.isEmpty() ) { currentServerConfig = -1; @@ -429,14 +429,14 @@ void OpieFtp::localUpload() } } else { QMessageBox::message(tr("Note"),tr("Cannot upload directories")); } ProgressBar->reset(); nullifyCallBack(); - it.current()->setSelected(FALSE); } //end currentSelected + it.current()->setSelected(FALSE); } TabWidget->setCurrentPage(1); remoteDirList( (const QString &)currentRemoteDir); //this also calls populate QCopEnvelope ( "QPE/System", "notBusy()" ); } @@ -483,14 +483,14 @@ void OpieFtp::remoteDownload() msg.sprintf(tr("Unable to download \n")+"%s",FtpLastResponse(conn)); msg.replace(QRegExp(":"),"\n"); QMessageBox::message(tr("Note"),msg); } ProgressBar->reset(); nullifyCallBack(); - it.current()->setSelected(FALSE); } + it.current()->setSelected(FALSE); } TabWidget->setCurrentPage(0); populateLocalView(); QCopEnvelope ( "QPE/System", "notBusy()" ); } @@ -654,13 +654,13 @@ bool OpieFtp::populateRemoteView( ) return true; } void OpieFtp::remoteListClicked(QListViewItem *selectedItem) { if( selectedItem) { - QCopEnvelope ( "QPE/System", "busy()" ); +// QCopEnvelope ( "QPE/System", "busy()" ); QString oldRemoteCurrentDir = currentRemoteDir; QString strItem=selectedItem->text(0); strItem=strItem.simplifyWhiteSpace(); if(strItem == "../") { // the user wants to go ^ if( FtpCDUp( conn) == 0) { QString msg; @@ -683,34 +683,34 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) strItem=strItem.right( strItem.length() - strItem.find("->",0,TRUE) - 2 ); strItem = strItem.stripWhiteSpace(); currentRemoteDir = strItem; if( !remoteChDir( (const QString &)strItem)) { currentRemoteDir = oldRemoteCurrentDir; strItem=""; - qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); +// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); } } else if(strItem.find("/",0,TRUE) != -1) { // this is a directory - qDebug("trying directory"); if( !remoteChDir( (const QString &)currentRemoteDir + strItem)) { currentRemoteDir = oldRemoteCurrentDir; strItem=""; - qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); +// qDebug("RemoteCurrentDir1 "+oldRemoteCurrentDir); } else { currentRemoteDir = currentRemoteDir+strItem; } } else { - qDebug("download "+strItem); + QCopEnvelope ( "QPE/System", "notBusy()" ); + return; } } remoteDirList( (const QString &)currentRemoteDir); //this also calls populate if(currentRemoteDir.right(1) !="/") currentRemoteDir +="/"; - currentPathCombo->lineEdit()->setText( currentRemoteDir ); - fillRemoteCombo( (const QString &)currentDir); - QCopEnvelope ( "QPE/System", "notBusy()" ); + currentPathCombo->lineEdit()->setText( currentRemoteDir); + fillRemoteCombo( (const QString &)currentRemoteDir); +// QCopEnvelope ( "QPE/System", "notBusy()" ); } } void OpieFtp::localListClicked(QListViewItem *selectedItem) { if(selectedItem!= NULL) { @@ -724,12 +724,13 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) if(QDir(strItem2).exists() ) { currentDir.cd(strItem2, TRUE); populateLocalView(); } } else { // not a symlink if(strItem.find(". .",0,TRUE) && strItem.find("/",0,TRUE)!=-1 ) { + if(QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem)).exists() ) { strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); currentDir.cd(strItem,FALSE); populateLocalView(); } else { currentDir.cdUp(); @@ -740,12 +741,13 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) populateLocalView(); } } else { strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); if( QFile::exists(strItem ) ) { // qDebug("upload "+strItem); + return; } } //end not symlink chdir(strItem.latin1()); } } } @@ -1065,18 +1067,22 @@ void OpieFtp::readConfig() currentServerConfig = cfg.readNumEntry("currentServer", -1); serverComboSelected( currentServerConfig); } void OpieFtp::writeConfig() { - Config cfg("opieftp"); cfg.setGroup("Server"); QString username, remoteServerStr, remotePathStr, password, port, temp; int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); if( currentServerConfig == -1) { + for (int i = 1; i <= numberOfEntries; i++) { + temp.setNum(i); + cfg.setGroup("Server"); + QString tempStr = cfg.readEntry( temp,""); + } temp.setNum( numberOfEntries + 1); cfg.setGroup("Server"); remoteServerStr = cfg.readEntry( temp,""); int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider); @@ -1087,13 +1093,12 @@ void OpieFtp::writeConfig() cfg.setGroup(temp); cfg.writeEntry("RemotePath", remotePath->text()); cfg.writeEntry("Username", UsernameComboBox->currentText()); cfg.writeEntryCrypt( UsernameComboBox->currentText(), PasswordEdit->text()); cfg.setGroup("Server"); cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 )); - } } void OpieFtp::fillCombos() { Config cfg("opieftp"); |