-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 24 |
1 files changed, 18 insertions, 6 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 @@ -299,10 +299,12 @@ OpieFtp::OpieFtp( ) layout->addMultiCellWidget( ProgressBar, 4, 4, 0, 4); -// fillCombos(); + fillCombos(); filterStr="*"; b=FALSE; populateLocalView(); - readConfig(); +qDebug("read COnfig"); + readConfig(); + qDebug("Set current item"); ServerComboBox->setCurrentItem(currentServerConfig); @@ -432,5 +434,6 @@ void OpieFtp::connector() remoteDirList("/") ; setCaption(ftp_host); - writeConfig(); + if( currentServerConfig == -1) + writeConfig(); connectServerBtn->setText( tr("Disconnect")); // QCopEnvelope ( "QPE/System", "notBusy()" ); @@ -1146,4 +1149,5 @@ void OpieFtp::readConfig() cfg.setGroup("Server"); currentServerConfig = cfg.readNumEntry("currentServer", -1); + // qDebug("Reading %d", currentServerConfig); serverComboSelected( currentServerConfig); @@ -1171,4 +1175,5 @@ void OpieFtp::writeConfig() cfg.setGroup("Server"); cfg.writeEntry( temp, ServerComboBox->currentText() +":"+PortSpinBox->cleanText() ); + cfg.writeEntry("currentServer", numberOfEntries+1); cfg.setGroup(temp); cfg.writeEntry("RemotePath", remotePath->text()); @@ -1177,4 +1182,5 @@ void OpieFtp::writeConfig() cfg.setGroup("Server"); cfg.writeEntry("numberOfEntries", QString::number(numberOfEntries + 1 )); + } } @@ -1188,6 +1194,8 @@ void OpieFtp::fillCombos() 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); @@ -1196,4 +1204,5 @@ void OpieFtp::fillCombos() remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider); + qDebug( remoteServerStr); ServerComboBox->insertItem( remoteServerStr ); // cfg.setGroup(temp); @@ -1224,6 +1233,7 @@ void OpieFtp::serverComboSelected(int index) 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); @@ -1240,8 +1250,10 @@ void OpieFtp::serverComboSelected(int index) 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); |