author | llornkcor <llornkcor> | 2002-05-16 16:29:14 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-16 16:29:14 (UTC) |
commit | 62c1424c5421e926173133ab4acd7346c590612e (patch) (side-by-side diff) | |
tree | f9df1716b94df11330bb7cb466e26d2e3d1f8add | |
parent | b94bd6003bf7c2024b0f254805f54ff4e52ead6e (diff) | |
download | opie-62c1424c5421e926173133ab4acd7346c590612e.zip opie-62c1424c5421e926173133ab4acd7346c590612e.tar.gz opie-62c1424c5421e926173133ab4acd7346c590612e.tar.bz2 |
fixed not loading ftp configs correctly..
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 7ca3fff..293c391 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp @@ -297,14 +297,16 @@ OpieFtp::OpieFtp( ) ProgressBar = new QProgressBar( this, "ProgressBar" ); layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4); -// fillCombos(); + fillCombos(); filterStr="*"; b=FALSE; populateLocalView(); +qDebug("read COnfig"); readConfig(); + qDebug("Set current item"); ServerComboBox->setCurrentItem(currentServerConfig); TabWidget->setCurrentPage(2); } @@ -430,8 +432,9 @@ void OpieFtp::connector() return ; } remoteDirList("/") ; setCaption(ftp_host); + if( currentServerConfig == -1) writeConfig(); connectServerBtn->setText( tr("Disconnect")); // QCopEnvelope ( "QPE/System", "notBusy()" ); } @@ -1144,8 +1147,9 @@ void OpieFtp::readConfig() fillCombos(); Config cfg("opieftp"); cfg.setGroup("Server"); currentServerConfig = cfg.readNumEntry("currentServer", -1); + // qDebug("Reading %d", currentServerConfig); serverComboSelected( currentServerConfig); } @@ -1169,14 +1173,16 @@ void OpieFtp::writeConfig() temp.setNum(numberOfEntries+1); cfg.setGroup("Server"); cfg.writeEntry( temp, ServerComboBox->currentText() +":"+PortSpinBox->cleanText() ); + cfg.writeEntry("currentServer", numberOfEntries+1); cfg.setGroup(temp); cfg.writeEntry("RemotePath", remotePath->text()); cfg.writeEntry("Username", UsernameComboBox->currentText()); cfg.writeEntryCrypt( UsernameComboBox->currentText(), PasswordEdit->text()); cfg.setGroup("Server"); cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 )); + } } void OpieFtp::fillCombos() @@ -1186,16 +1192,19 @@ void OpieFtp::fillCombos() QString username, remoteServerStr, remotePathStr, password, port, temp; int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); for (int i = 1; i <= numberOfEntries; i++) { temp.setNum(i); + qDebug(temp); cfg.setGroup("Server"); remoteServerStr = cfg.readEntry( temp,""); + qDebug( remoteServerStr); 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( remoteServerStr); ServerComboBox->insertItem( remoteServerStr ); // cfg.setGroup(temp); // remotePathStr = cfg.readEntry(remoteServer,""); @@ -1222,10 +1231,11 @@ void OpieFtp::serverComboSelected(int index) Config cfg("opieftp"); cfg.setGroup("Server"); int numberOfEntries = cfg.readNumEntry("numberOfEntries",0); - temp.setNum(index+1); + temp.setNum(index); 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); @@ -1238,11 +1248,13 @@ void OpieFtp::serverComboSelected(int index) 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); |