author | llornkcor <llornkcor> | 2002-04-05 01:34:24 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-05 01:34:24 (UTC) |
commit | dd5bc1f9d61cdd8cfde4c7a7fbba3b53b77b2670 (patch) (unidiff) | |
tree | e8ebf3f926e3ac7e4d612964a05bce834fe6fc2e /noncore/net/opieftp | |
parent | 8674b15e0768d5108d9a225ff2631538283e1019 (diff) | |
download | opie-dd5bc1f9d61cdd8cfde4c7a7fbba3b53b77b2670.zip opie-dd5bc1f9d61cdd8cfde4c7a7fbba3b53b77b2670.tar.gz opie-dd5bc1f9d61cdd8cfde4c7a7fbba3b53b77b2670.tar.bz2 |
fixed bug where same server was being saved multiple times
-rw-r--r-- | noncore/net/opieftp/opieftp.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index b451925..919649e 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -116,7 +116,7 @@ OpieFtp::OpieFtp( ) | |||
116 | TabWidget = new QTabWidget( this, "TabWidget" ); | 116 | TabWidget = new QTabWidget( this, "TabWidget" ); |
117 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 3 ); | 117 | layout->addMultiCellWidget( TabWidget, 1, 1, 0, 3 ); |
118 | 118 | ||
119 | TabWidget->setTabShape(QTabWidget::Triangular); | 119 | // TabWidget->setTabShape(QTabWidget::Triangular); |
120 | 120 | ||
121 | tab = new QWidget( TabWidget, "tab" ); | 121 | tab = new QWidget( TabWidget, "tab" ); |
122 | tabLayout = new QGridLayout( tab ); | 122 | tabLayout = new QGridLayout( tab ); |
@@ -267,7 +267,8 @@ OpieFtp::OpieFtp( ) | |||
267 | b=FALSE; | 267 | b=FALSE; |
268 | populateLocalView(); | 268 | populateLocalView(); |
269 | readConfig(); | 269 | readConfig(); |
270 | ServerComboBox->setCurrentItem(currentServerConfig); | 270 | ServerComboBox->setCurrentItem(currentServerConfig); |
271 | |||
271 | TabWidget->setCurrentPage(2); | 272 | TabWidget->setCurrentPage(2); |
272 | } | 273 | } |
273 | 274 | ||
@@ -323,9 +324,9 @@ void OpieFtp::newConnection() | |||
323 | 324 | ||
324 | void OpieFtp::serverComboEdited(const QString & edit) | 325 | void OpieFtp::serverComboEdited(const QString & edit) |
325 | { | 326 | { |
326 | if( !edit.isEmpty() ) { | 327 | if( ServerComboBox->text(currentServerConfig) != edit /*edit.isEmpty() */) { |
328 | qDebug("ServerComboEdited"); | ||
327 | currentServerConfig = -1; | 329 | currentServerConfig = -1; |
328 | // qDebug("comboedited"); | ||
329 | } | 330 | } |
330 | } | 331 | } |
331 | 332 | ||
@@ -523,7 +524,7 @@ bool OpieFtp::remoteChDir(const QString &dir) | |||
523 | msg.sprintf(tr("Unable to change directories\n")+dir+"\n%s",FtpLastResponse(conn)); | 524 | msg.sprintf(tr("Unable to change directories\n")+dir+"\n%s",FtpLastResponse(conn)); |
524 | msg.replace(QRegExp(":"),"\n"); | 525 | msg.replace(QRegExp(":"),"\n"); |
525 | QMessageBox::message(tr("Note"),msg); | 526 | QMessageBox::message(tr("Note"),msg); |
526 | qDebug(msg); | 527 | // qDebug(msg); |
527 | QCopEnvelope ( "QPE/System", "notBusy()" ); | 528 | QCopEnvelope ( "QPE/System", "notBusy()" ); |
528 | return FALSE; | 529 | return FALSE; |
529 | } | 530 | } |
@@ -667,7 +668,7 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
667 | msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn)); | 668 | msg.sprintf(tr("Unable to cd up\n")+"%s",FtpLastResponse(conn)); |
668 | msg.replace(QRegExp(":"),"\n"); | 669 | msg.replace(QRegExp(":"),"\n"); |
669 | QMessageBox::message(tr("Note"),msg); | 670 | QMessageBox::message(tr("Note"),msg); |
670 | qDebug(msg); | 671 | // qDebug(msg); |
671 | } | 672 | } |
672 | char path[256]; | 673 | char path[256]; |
673 | if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string | 674 | if( FtpPwd( path,sizeof(path),conn) == 0) { //this is easier than fudging the string |
@@ -675,7 +676,7 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) | |||
675 | msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn)); | 676 | msg.sprintf(tr("Unable to get working dir\n")+"%s",FtpLastResponse(conn)); |
676 | msg.replace(QRegExp(":"),"\n"); | 677 | msg.replace(QRegExp(":"),"\n"); |
677 | QMessageBox::message(tr("Note"),msg); | 678 | QMessageBox::message(tr("Note"),msg); |
678 | qDebug(msg); | 679 | // qDebug(msg); |
679 | } | 680 | } |
680 | currentRemoteDir=path; | 681 | currentRemoteDir=path; |
681 | } else { | 682 | } else { |
@@ -1065,6 +1066,7 @@ void OpieFtp::readConfig() | |||
1065 | Config cfg("opieftp"); | 1066 | Config cfg("opieftp"); |
1066 | cfg.setGroup("Server"); | 1067 | cfg.setGroup("Server"); |
1067 | currentServerConfig = cfg.readNumEntry("currentServer", -1); | 1068 | currentServerConfig = cfg.readNumEntry("currentServer", -1); |
1069 | // qDebug("Reading %d", currentServerConfig); | ||
1068 | serverComboSelected( currentServerConfig); | 1070 | serverComboSelected( currentServerConfig); |
1069 | } | 1071 | } |
1070 | 1072 | ||
@@ -1080,7 +1082,6 @@ void OpieFtp::writeConfig() | |||
1080 | cfg.setGroup("Server"); | 1082 | cfg.setGroup("Server"); |
1081 | QString tempStr = cfg.readEntry( temp,""); | 1083 | QString tempStr = cfg.readEntry( temp,""); |
1082 | } | 1084 | } |
1083 | |||
1084 | temp.setNum( numberOfEntries + 1); | 1085 | temp.setNum( numberOfEntries + 1); |
1085 | cfg.setGroup("Server"); | 1086 | cfg.setGroup("Server"); |
1086 | remoteServerStr = cfg.readEntry( temp,""); | 1087 | remoteServerStr = cfg.readEntry( temp,""); |