summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-30 02:00:10 (UTC)
committer llornkcor <llornkcor>2002-03-30 02:00:10 (UTC)
commit4fc58d156db9197bc8299f040d4337ea85b9f0d2 (patch) (side-by-side diff)
tree7baa553895a5ccdb35c8309b8a5c43a8f05a24ec
parente49717bf2fa15791c2437a3ac69058ac909f0c6b (diff)
downloadopie-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
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opieftp/opieftp.cpp89
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
@@ -133,5 +133,5 @@ OpieFtp::OpieFtp( )
Local_View->setAllColumnsShowFocus(TRUE);
Local_View->setMultiSelection( TRUE );
-
+ Local_View->setSelectionMode(QlistView::Extended);
QPEApplication::setStylusOperation( Local_View->viewport(),QPEApplication::RightOnHold);
@@ -162,4 +162,5 @@ OpieFtp::OpieFtp( )
Remote_View->setAllColumnsShowFocus(TRUE);
Remote_View->setMultiSelection( TRUE );
+ Remote_View->setSelectionMode(QlistView::Extended);
QPEApplication::setStylusOperation( Remote_View->viewport(),QPEApplication::RightOnHold);
@@ -286,4 +287,5 @@ void OpieFtp::cleanUp()
if(file.exists())
file.remove();
+ exit(0);
}
@@ -395,5 +397,4 @@ void OpieFtp::disConnector()
connectServerBtn->setText( tr("Connect"));
connectServerBtn->setOn(FALSE);
-
}
@@ -404,38 +405,38 @@ void OpieFtp::localUpload()
// qApp->processEvents();
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()" );
}
@@ -486,5 +487,5 @@ void OpieFtp::remoteDownload()
ProgressBar->reset();
nullifyCallBack();
- it.current()->setSelected(FALSE);
+ it.current()->setSelected(FALSE);
}
}
@@ -523,5 +524,5 @@ bool OpieFtp::remoteChDir(const QString &dir)
msg.replace(QRegExp(":"),"\n");
QMessageBox::message(tr("Note"),msg);
- qDebug(msg);
+ qDebug(msg);
QCopEnvelope ( "QPE/System", "notBusy()" );
return FALSE;
@@ -781,6 +782,6 @@ void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &point,
{
// if(item)
-if (mouse == 2) {
- showLocalMenu(item);
+ if (mouse == 2) {
+ showLocalMenu(item);
}
}
@@ -788,11 +789,7 @@ if (mouse == 2) {
void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i)
{
- switch (mouse) {
- case 1:
- break;
- case 2:
- showRemoteMenu(item);
- break;
- };
+ if(mouse == 2) {
+ showRemoteMenu(item);
+ }
}