author | llornkcor <llornkcor> | 2002-03-30 02:00:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-30 02:00:10 (UTC) |
commit | 4fc58d156db9197bc8299f040d4337ea85b9f0d2 (patch) (unidiff) | |
tree | 7baa553895a5ccdb35c8309b8a5c43a8f05a24ec | |
parent | e49717bf2fa15791c2437a3ac69058ac909f0c6b (diff) | |
download | opie-4fc58d156db9197bc8299f040d4337ea85b9f0d2.zip opie-4fc58d156db9197bc8299f040d4337ea85b9f0d2.tar.gz opie-4fc58d156db9197bc8299f040d4337ea85b9f0d2.tar.bz2 |
fixed a workaround for an apparent bug in libqte when the listview is multi, and you try to select one item and popup the menu.., it needs extended mode selection to work
-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( ) | |||
134 | Local_View->setMultiSelection( TRUE ); | 134 | Local_View->setMultiSelection( TRUE ); |
135 | 135 | Local_View->setSelectionMode(QlistView::Extended); | |
136 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); | 136 | QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold); |
@@ -163,2 +163,3 @@ OpieFtp::OpieFtp( ) | |||
163 | Remote_View->setMultiSelection( TRUE ); | 163 | Remote_View->setMultiSelection( TRUE ); |
164 | Remote_View->setSelectionMode(QlistView::Extended); | ||
164 | 165 | ||
@@ -287,2 +288,3 @@ void OpieFtp::cleanUp() | |||
287 | file.remove(); | 288 | file.remove(); |
289 | exit(0); | ||
288 | } | 290 | } |
@@ -396,3 +398,2 @@ void OpieFtp::disConnector() | |||
396 | connectServerBtn->setOn(FALSE); | 398 | connectServerBtn->setOn(FALSE); |
397 | |||
398 | } | 399 | } |
@@ -405,36 +406,36 @@ void OpieFtp::localUpload() | |||
405 | QList<QListViewItem> * getSelectedItems( QListView * Local_View ); | 406 | QList<QListViewItem> * getSelectedItems( QListView * Local_View ); |
406 | QListViewItemIterator it( Local_View ); | 407 | QListViewItemIterator it( Local_View ); |
407 | for ( ; it.current(); ++it ) { | 408 | for ( ; it.current(); ++it ) { |
408 | if ( it.current()->isSelected() ) { | 409 | if ( it.current()->isSelected() ) { |
409 | QString strItem = it.current()->text(0); | 410 | QString strItem = it.current()->text(0); |
410 | QString localFile = currentDir.canonicalPath()+"/"+strItem; | 411 | QString localFile = currentDir.canonicalPath()+"/"+strItem; |
411 | QString remoteFile= currentRemoteDir+strItem; | 412 | QString remoteFile= currentRemoteDir+strItem; |
412 | QFileInfo fi(localFile); | 413 | QFileInfo fi(localFile); |
413 | if( !fi.isDir()) { | 414 | if( !fi.isDir()) { |
414 | fsz=fi.size(); | 415 | fsz=fi.size(); |
415 | ProgressBar->setTotalSteps(fsz); | 416 | ProgressBar->setTotalSteps(fsz); |
416 | 417 | ||
417 | FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn); | 418 | FtpOptions(FTPLIB_CALLBACK, (long) log_progress, conn); |
418 | FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn); | 419 | FtpOptions(FTPLIB_IDLETIME, (long) 1000, conn); |
419 | FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn); | 420 | FtpOptions(FTPLIB_CALLBACKARG, (long) &fsz, conn); |
420 | FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn); | 421 | FtpOptions(FTPLIB_CALLBACKBYTES, (long) fsz/10, conn); |
421 | qDebug("Put: %s, %s",localFile.latin1(),remoteFile.latin1()); | 422 | qDebug("Put: %s, %s",localFile.latin1(),remoteFile.latin1()); |
422 | 423 | ||
423 | if( !FtpPut( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { | 424 | if( !FtpPut( localFile.latin1(), remoteFile.latin1(),FTPLIB_IMAGE, conn ) ) { |
424 | QString msg; | 425 | QString msg; |
425 | msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn)); | 426 | msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn)); |
426 | msg.replace(QRegExp(":"),"\n"); | 427 | msg.replace(QRegExp(":"),"\n"); |
427 | QMessageBox::message(tr("Note"),msg); | 428 | QMessageBox::message(tr("Note"),msg); |
428 | } | ||
429 | } else { | ||
430 | QMessageBox::message(tr("Note"),tr("Cannot upload directories")); | ||
431 | } | 429 | } |
432 | ProgressBar->reset(); | 430 | } else { |
433 | nullifyCallBack(); | 431 | QMessageBox::message(tr("Note"),tr("Cannot upload directories")); |
434 | it.current()->setSelected(FALSE); | 432 | } |
435 | } //end currentSelected | 433 | ProgressBar->reset(); |
436 | } | 434 | nullifyCallBack(); |
437 | TabWidget->setCurrentPage(1); | 435 | it.current()->setSelected(FALSE); |
438 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | 436 | } //end currentSelected |
439 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 437 | } |
438 | TabWidget->setCurrentPage(1); | ||
439 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | ||
440 | QCopEnvelope ( "QPE/System", "notBusy()" ); | ||
440 | } | 441 | } |
@@ -487,3 +488,3 @@ void OpieFtp::remoteDownload() | |||
487 | nullifyCallBack(); | 488 | nullifyCallBack(); |
488 | it.current()->setSelected(FALSE); | 489 | it.current()->setSelected(FALSE); |
489 | } | 490 | } |
@@ -524,3 +525,3 @@ bool OpieFtp::remoteChDir(const QString &dir) | |||
524 | QMessageBox::message(tr("Note"),msg); | 525 | QMessageBox::message(tr("Note"),msg); |
525 | qDebug(msg); | 526 | qDebug(msg); |
526 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 527 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
@@ -782,4 +783,4 @@ void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &point, | |||
782 | // if(item) | 783 | // if(item) |
783 | if (mouse == 2) { | 784 | if (mouse == 2) { |
784 | showLocalMenu(item); | 785 | showLocalMenu(item); |
785 | } | 786 | } |
@@ -789,9 +790,5 @@ void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &p | |||
789 | { | 790 | { |
790 | switch (mouse) { | 791 | if(mouse == 2) { |
791 | case 1: | 792 | showRemoteMenu(item); |
792 | break; | 793 | } |
793 | case 2: | ||
794 | showRemoteMenu(item); | ||
795 | break; | ||
796 | }; | ||
797 | } | 794 | } |