author | simon <simon> | 2002-11-08 15:16:56 (UTC) |
---|---|---|
committer | simon <simon> | 2002-11-08 15:16:56 (UTC) |
commit | c2d39953b626147400114dbde85d87bdf5081576 (patch) (side-by-side diff) | |
tree | 137fdab93cbf9786d35a8060d0c1aebdfa552570 | |
parent | 0850f627522ed8765ffd37dfa47dc3c40fd543be (diff) | |
download | opie-c2d39953b626147400114dbde85d87bdf5081576.zip opie-c2d39953b626147400114dbde85d87bdf5081576.tar.gz opie-c2d39953b626147400114dbde85d87bdf5081576.tar.bz2 |
- for ( i; i <= numberOfEntries; i++) {
+ for ( ; i <= numberOfEntries; i++) {
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 3d97ecb..292cc9d 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp @@ -1287,193 +1287,193 @@ void OpieFtp::fillCombos() int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); port = remoteServerStr.right( divider - 1); bool ok; PortSpinBox->setValue( port.toInt(&ok,10)); remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider); qDebug( "remote server string "+remoteServerStr); ServerComboBox->insertItem( remoteServerStr ); cfg.setGroup(temp); username = cfg.readEntry(temp); UsernameComboBox->insertItem(username); password = cfg.readEntryCrypt(username,""); PasswordEdit->setText(password); serverListView->insertItem( cfg.readEntry("ServerName")); } } void OpieFtp::serverComboSelected(int index) { currentServerConfig = index+1; 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); temp.setNum(index+1); remoteServerStr = cfg.readEntry( temp,""); qDebug("Group" +temp); cfg.setGroup(temp); // qDebug(temp); int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); port = remoteServerStr.right( divider - 1); bool ok; int portInt = port.toInt(&ok,10); if( portInt == 0) portInt = 21; ServerComboBox->lineEdit()->setText(remoteServerStr.left( remoteServerStr.find(":",0,TRUE))); PortSpinBox->setValue( portInt); remotePath->setText(cfg.readEntry("RemotePath", "/")); username = cfg.readEntry("Username", "anonymous"); UsernameComboBox->lineEdit()->setText(username); qDebug(username); // qDebug("Password is "+cfg.readEntryCrypt(username, "me@opieftp.org")); PasswordEdit->setText(cfg.readEntryCrypt(username, "me@opieftp.org")); // UsernameComboBox // PasswordEdit cfg.setGroup("Server"); temp.sprintf("%d",currentServerConfig); cfg.writeEntry("currentServer", temp); fuckeduphack = TRUE; serverListView->setCurrentItem( index); fuckeduphack=FALSE; qDebug("server list set selected %d",index); update(); } void OpieFtp::deleteServer() { QString username, remoteServerStr, remotePathStr, password, port, temp, servername; remoteServerStr = ServerComboBox->currentText( ); username = UsernameComboBox->currentText(); servername=serverListView->currentText(); Config cfg("opieftp"); cfg.setGroup("Server"); QString tempname; int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); for (int i = 1; i <= numberOfEntries; i++) { temp.setNum(i); // cfg.setGroup("Server"); cfg.setGroup(QString::number(i)); tempname=cfg.readEntry( "ServerName",""); if( tempname.find( servername,0,TRUE) != -1 ) { // servername.find( cfg.readEntry("ServerName")) != -1 && // remoteServerStr.find( cfg.readEntry("RemotePath")) != -1 && // username.find( cfg.readEntry("Username")) != -1) { serverListView->removeItem(i); qDebug("OK DELETE "+tempname); cfg.removeEntry(QString::number(i)); - for ( i; i <= numberOfEntries; i++) { + for ( ; i <= numberOfEntries; i++) { cfg.setGroup("Server"); cfg.writeEntry("Server", QString::number(numberOfEntries + 1 )); cfg.setGroup(QString::number(i+1)); //get next server config servername=cfg.readEntry("ServerName"); remoteServerStr=cfg.readEntry("RemotePath"); username=cfg.readEntry("Username"); password=cfg.readEntryCrypt( username); cfg.setGroup(QString::number(i)); cfg.writeEntry("RemotePath", remoteServerStr); cfg.writeEntry("ServerName", servername); cfg.writeEntry("Username", username); cfg.writeEntryCrypt( username, password); } cfg.setGroup("Server"); cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries - 1 )); } } cfg.setGroup(QString::number(numberOfEntries)); cfg.removeEntry("Server"); cfg.removeEntry("RemotePath"); cfg.removeEntry("ServerName"); username=cfg.readEntry("Username"); cfg.removeEntry("Username"); cfg.removeEntry(username); currentServerConfig=currentServerConfig-1; fillCombos(); update(); } void OpieFtp::upDir() { if (TabWidget->currentPageIndex() == 0) { QString current = currentDir.canonicalPath(); QDir dir(current); dir.cdUp(); current = dir.canonicalPath(); chdir( current.latin1() ); currentDir.cd( current, TRUE); populateLocalView(); update(); } else { if( FtpCDUp( conn) == 0) { QString msg; msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn)); msg.replace(QRegExp(":"),"\n"); QMessageBox::message(tr("Note"),msg); // qDebug(msg); } char path[256]; if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string QString msg; msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn)); msg.replace(QRegExp(":"),"\n"); QMessageBox::message(tr("Note"),msg); // qDebug(msg); } currentRemoteDir=path; remoteDirList( (const QString &)currentRemoteDir); //this also calls populate if(currentRemoteDir.right(1) !="/") currentRemoteDir +="/"; currentPathCombo->lineEdit()->setText( currentRemoteDir); fillRemoteCombo( (const QString &)currentRemoteDir); } } void OpieFtp::docButtonPushed() { QString current = QPEApplication::documentDir(); chdir( current.latin1() ); currentDir.cd( current, TRUE); populateLocalView(); update(); } void OpieFtp::homeButtonPushed() { QString current = QDir::homeDirPath(); chdir( current.latin1() ); currentDir.cd( current, TRUE); populateLocalView(); update(); } void OpieFtp::doAbout() { QMessageBox::message("OpieFtp","Opie ftp client is copyright 2002 by\n" "L.J.Potter<llornkcor@handhelds.org>\n" "and uses ftplib copyright 1996-2000\n" "by Thomas Pfau, pfau@cnj.digex.net\n\n" "and is licensed by the GPL"); } |