-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 89 |
1 files changed, 43 insertions, 46 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 3e13466..956409f 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp @@ -134,3 +134,3 @@ OpieFtp::OpieFtp( ) Local_View->setMultiSelection( TRUE ); - + Local_View->setSelectionMode(QlistView::Extended); QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); @@ -163,2 +163,3 @@ OpieFtp::OpieFtp( ) Remote_View->setMultiSelection( TRUE ); + Remote_View->setSelectionMode(QlistView::Extended); @@ -287,2 +288,3 @@ void OpieFtp::cleanUp() file.remove(); + exit(0); } @@ -396,3 +398,2 @@ void OpieFtp::disConnector() connectServerBtn->setOn(FALSE); - } @@ -405,36 +406,36 @@ void OpieFtp::localUpload() QList<QListViewItem> * getSelectedItems( QListView * Local_View ); - QListViewItemIterator it( Local_View ); - for ( ; it.current(); ++it ) { - if ( it.current()->isSelected() ) { - QString strItem = it.current()->text(0); - QString localFile = currentDir.canonicalPath()+"/"+strItem; - QString remoteFile= currentRemoteDir+strItem; - QFileInfo fi(localFile); - if( !fi.isDir()) { - fsz=fi.size(); - ProgressBar->setTotalSteps(fsz); - - FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn); - FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn); - FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn); - FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn); - qDebug("Put: %s, %s",localFile.latin1(),remoteFile.latin1()); - - if( !FtpPut( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { - QString msg; - msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn)); - msg.replace(QRegExp(":"),"\n"); - QMessageBox::message(tr("Note"),msg); - } - } else { - QMessageBox::message(tr("Note"),tr("Cannot upload directories")); + QListViewItemIterator it( Local_View ); + for ( ; it.current(); ++it ) { + if ( it.current()->isSelected() ) { + QString strItem = it.current()->text(0); + QString localFile = currentDir.canonicalPath()+"/"+strItem; + QString remoteFile= currentRemoteDir+strItem; + QFileInfo fi(localFile); + if( !fi.isDir()) { + fsz=fi.size(); + ProgressBar->setTotalSteps(fsz); + + FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn); + FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn); + FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn); + FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn); + qDebug("Put: %s, %s",localFile.latin1(),remoteFile.latin1()); + + if( !FtpPut( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { + QString msg; + msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn)); + msg.replace(QRegExp(":"),"\n"); + QMessageBox::message(tr("Note"),msg); } - ProgressBar->reset(); - nullifyCallBack(); - it.current()->setSelected(FALSE); - } //end currentSelected - } - TabWidget->setCurrentPage(1); - remoteDirList( (const QString &)currentRemoteDir); //this also calls populate - QCopEnvelope ( "QPE/System", "notBusy()" ); + } else { + QMessageBox::message(tr("Note"),tr("Cannot upload directories")); + } + ProgressBar->reset(); + nullifyCallBack(); + it.current()->setSelected(FALSE); + } //end currentSelected + } + TabWidget->setCurrentPage(1); + remoteDirList( (const QString &)currentRemoteDir); //this also calls populate + QCopEnvelope ( "QPE/System", "notBusy()" ); } @@ -487,3 +488,3 @@ void OpieFtp::remoteDownload() nullifyCallBack(); - it.current()->setSelected(FALSE); + it.current()->setSelected(FALSE); } @@ -524,3 +525,3 @@ bool OpieFtp::remoteChDir(const QString &dir) QMessageBox::message(tr("Note"),msg); - qDebug(msg); + qDebug(msg); QCopEnvelope ( "QPE/System", "notBusy()" ); @@ -782,4 +783,4 @@ void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &point, // if(item) -if (mouse == 2) { - showLocalMenu(item); + if (mouse == 2) { + showLocalMenu(item); } @@ -789,9 +790,5 @@ void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &p { - switch (mouse) { - case 1: - break; - case 2: - showRemoteMenu(item); - break; - }; + if(mouse == 2) { + showRemoteMenu(item); + } } |