-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 9beac94..4e14946 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp @@ -57,16 +57,16 @@ extern "C" { #include <stdlib.h> QProgressBar *ProgressBar; static netbuf *conn=NULL; -static int log_progress(netbuf *ctl, int xfered, void *arg) +static int log_progress(netbuf *, int xfered, void *) { - int fsz = *(int *)arg; - int pct = (xfered * 100) / fsz; +// int fsz = *(int *)arg; +// int pct = (xfered * 100) / fsz; // printf("%3d%%\r", pct); // fflush(stdout); ProgressBar->setProgress(xfered); qApp->processEvents(); return 1; } @@ -222,35 +222,38 @@ OpieFtp::OpieFtp( ) tabLayout_3->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 ); UsernameComboBox = new QComboBox( FALSE, tab_3, "UsernameComboBox" ); UsernameComboBox->setEditable(TRUE); tabLayout_3->addMultiCellWidget( UsernameComboBox, 1, 1, 0, 1 ); - connect( UsernameComboBox,SIGNAL(textChanged(const QString &)),this,SLOT( UsernameComboBoxEdited(const QString & ) )); + connect( UsernameComboBox,SIGNAL(textChanged(const QString &)),this, + SLOT( UsernameComboBoxEdited(const QString & ) )); TextLabel2 = new QLabel( tab_3, "TextLabel2" ); TextLabel2->setText( tr( "Password" ) ); tabLayout_3->addMultiCellWidget( TextLabel2, 0, 0, 2, 3 ); PasswordEdit = new QLineEdit( "", tab_3, "PasswordComboBox" ); PasswordEdit->setEchoMode(QLineEdit::Password); tabLayout_3->addMultiCellWidget( PasswordEdit, 1, 1, 2, 3 ); - connect( PasswordEdit,SIGNAL(textChanged(const QString &)),this,SLOT( PasswordEditEdited(const QString & ) )); + connect( PasswordEdit,SIGNAL(textChanged(const QString &)),this, + SLOT( PasswordEditEdited(const QString & ) )); //PasswordEdit->setFixedWidth(85); TextLabel3 = new QLabel( tab_3, "TextLabel3" ); TextLabel3->setText( tr( "Remote server" ) ); tabLayout_3->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 ); ServerComboBox = new QComboBox( FALSE, tab_3, "ServerComboBox" ); ServerComboBox->setEditable(TRUE); tabLayout_3->addMultiCellWidget( ServerComboBox, 3, 3, 0, 1 ); connect(ServerComboBox,SIGNAL(activated(int)),this,SLOT(serverComboSelected(int ) )); - connect(ServerComboBox,SIGNAL(textChanged(const QString &)),this,SLOT(serverComboEdited(const QString & ) )); + connect(ServerComboBox,SIGNAL(textChanged(const QString &)),this, + SLOT(serverComboEdited(const QString & ) )); QLabel *TextLabel5 = new QLabel( tab_3, "TextLabel5" ); TextLabel5->setText( tr( "Remote path" ) ); tabLayout_3->addMultiCellWidget( TextLabel5, 2, 2, 2, 3 ); @@ -344,13 +347,13 @@ void OpieFtp::cleanUp() cfg.setGroup("Server"); cfg.writeEntry("currentServer", currentServerConfig); exit(0); } -void OpieFtp::tabChanged(QWidget *w) +void OpieFtp::tabChanged(QWidget *) { if (TabWidget->currentPageIndex() == 0) { currentPathCombo->lineEdit()->setText( currentDir.canonicalPath()); tabMenu->setItemChecked(tabMenu->idAt(0),TRUE); tabMenu->setItemChecked(tabMenu->idAt(1),FALSE); tabMenu->setItemChecked(tabMenu->idAt(2),FALSE); @@ -386,25 +389,25 @@ void OpieFtp::newConnection() ServerComboBox->lineEdit()->setText( ""); remotePath->setText( currentRemoteDir = "/"); PortSpinBox->setValue( 21); TabWidget->setCurrentPage(2); } -void OpieFtp::serverComboEdited(const QString & edit) +void OpieFtp::serverComboEdited(const QString & ) { // if( ServerComboBox->text(currentServerConfig) != edit /*edit.isEmpty() */) { // qDebug("ServerComboEdited"); // // currentServerConfig = -1; // } } -void OpieFtp::UsernameComboBoxEdited(const QString & use) { +void OpieFtp::UsernameComboBoxEdited(const QString &) { // currentServerConfig = -1; } -void OpieFtp::PasswordEditEdited(const QString & pass) { +void OpieFtp::PasswordEditEdited(const QString & ) { // currentServerConfig = -1; } void OpieFtp::connectorBtnToggled(bool On) { if(On) { @@ -439,13 +442,13 @@ void OpieFtp::connector() QString ftp_pass = PasswordEdit->text(); QString port=PortSpinBox->cleanText(); port.stripWhiteSpace(); Config cfg("opieftp"); cfg.setGroup("Server"); - int current=cfg.readNumEntry("currentServer", 1); +// int current=cfg.readNumEntry("currentServer", 1); // if(ftp_host!= cfg.readEntry(QString::number( current))) // currentServerConfig=-1; // cfg.setGroup(QString::number(current)); // if( ftp_user != cfg.readEntry("Username")) // currentServerConfig=-1; @@ -650,18 +653,18 @@ void OpieFtp::populateLocalView() QFileInfo *fi; while ( (fi=it.current()) ) { if (fi->isSymLink() ){ QString symLink=fi->readLink(); // qDebug("Symlink detected "+symLink); QFileInfo sym( symLink); - fileS.sprintf( "%10li", sym.size() ); + fileS.sprintf( "%10i", sym.size() ); fileL.sprintf( "%s -> %s", fi->fileName().data(),sym.absFilePath().data() ); fileDate = sym.lastModified().toString(); } else { // qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); - fileS.sprintf( "%10li", fi->size() ); + fileS.sprintf( "%10i", fi->size() ); fileL.sprintf( "%s",fi->fileName().data() ); fileDate= fi->lastModified().toString(); if( QDir(QDir::cleanDirPath(currentDir.canonicalPath()+"/"+fileL)).exists() ) { fileL+="/"; isDir=TRUE; // qDebug( fileL); @@ -811,12 +814,14 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) remoteDirList( (const QString &)currentRemoteDir); //this also calls populate if(currentRemoteDir.right(1) !="/") currentRemoteDir +="/"; currentPathCombo->lineEdit()->setText( currentRemoteDir); fillRemoteCombo( (const QString &)currentRemoteDir); // QCopEnvelope ( "QPE/System", "notBusy()" ); + Remote_View->ensureItemVisible(Remote_View->firstChild()); + } } void OpieFtp::localListClicked(QListViewItem *selectedItem) { if(selectedItem!= NULL) { @@ -852,12 +857,13 @@ void OpieFtp::localListClicked(QListViewItem *selectedItem) // qDebug("upload "+strItem); return; } } //end not symlink chdir(strItem.latin1()); } + Local_View->ensureItemVisible(Local_View->firstChild()); } } void OpieFtp::doLocalCd() { localListClicked( Local_View->currentItem()); @@ -883,21 +889,21 @@ void OpieFtp::showHidden() // currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); b=FALSE; } populateLocalView(); } -void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) +void OpieFtp::ListPressed( int mouse, QListViewItem *item, const QPoint &, int) { // if(item) if (mouse == 2) { showLocalMenu(item); } } -void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &point, int i) +void OpieFtp::RemoteListPressed( int mouse, QListViewItem *item, const QPoint &, int ) { if(mouse == 2) { showRemoteMenu(item); } } @@ -1302,13 +1308,13 @@ void OpieFtp::serverComboSelected(int index) qDebug("server combo selected %d", index+1); QString username, remoteServerStr, remotePathStr, password, port, temp; // remoteServerStr = ServerComboBox->text(index); Config cfg("opieftp"); cfg.setGroup("Server"); - int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); +// int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); temp.setNum(index+1); remoteServerStr = cfg.readEntry( temp,""); qDebug("Group" +temp); cfg.setGroup(temp); |