-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 @@ -113,13 +113,13 @@ OpieFtp::OpieFtp( ) tabMenu->insertItem( tr( "Switch to Config" ), this, SLOT( switchToConfigTab() )); tabMenu->setCheckable(TRUE); TabWidget = new QTabWidget( this, "TabWidget" ); layout->addMultiCellWidget( TabWidget, 1, 1, 0, 3 ); - TabWidget->setTabShape(QTabWidget::Triangular); +// TabWidget->setTabShape(QTabWidget::Triangular); tab = new QWidget( TabWidget, "tab" ); tabLayout = new QGridLayout( tab ); tabLayout->setSpacing( 2); tabLayout->setMargin( 2); @@ -264,13 +264,14 @@ OpieFtp::OpieFtp( ) // fillCombos(); filterStr="*"; b=FALSE; populateLocalView(); readConfig(); - ServerComboBox->setCurrentItem(currentServerConfig); + ServerComboBox->setCurrentItem(currentServerConfig); + TabWidget->setCurrentPage(2); } OpieFtp::~OpieFtp() { } @@ -320,15 +321,15 @@ void OpieFtp::newConnection() PortSpinBox->setValue( 21); TabWidget->setCurrentPage(2); } void OpieFtp::serverComboEdited(const QString & edit) { - if( !edit.isEmpty() ) { + if( ServerComboBox->text(currentServerConfig) != edit /*edit.isEmpty() */) { + qDebug("ServerComboEdited"); currentServerConfig = -1; -// qDebug("comboedited"); } } void OpieFtp::connectorBtnToggled(bool On) { if(On) { @@ -520,13 +521,13 @@ bool OpieFtp::remoteChDir(const QString &dir) QCopEnvelope ( "QPE/System", "busy()" ); if (!FtpChdir( dir.latin1(), conn )) { QString msg; msg.sprintf(tr("Unable to change directories\n")+dir+"\n%s",FtpLastResponse(conn)); msg.replace(QRegExp(":"),"\n"); QMessageBox::message(tr("Note"),msg); - qDebug(msg); +// qDebug(msg); QCopEnvelope ( "QPE/System", "notBusy()" ); return FALSE; } QCopEnvelope ( "QPE/System", "notBusy()" ); return TRUE; } @@ -664,21 +665,21 @@ void OpieFtp::remoteListClicked(QListViewItem *selectedItem) if(strItem == "../") { // the user wants to go ^ 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); +// 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); +// qDebug(msg); } currentRemoteDir=path; } else { if(strItem.find("->",0,TRUE) != -1) { //symlink on some servers strItem=strItem.right( strItem.length() - strItem.find("->",0,TRUE) - 2 ); strItem = strItem.stripWhiteSpace(); @@ -1062,12 +1063,13 @@ void OpieFtp::switchToConfigTab() void OpieFtp::readConfig() { fillCombos(); Config cfg("opieftp"); cfg.setGroup("Server"); currentServerConfig = cfg.readNumEntry("currentServer", -1); +// qDebug("Reading %d", currentServerConfig); serverComboSelected( currentServerConfig); } void OpieFtp::writeConfig() { Config cfg("opieftp"); @@ -1077,13 +1079,12 @@ void OpieFtp::writeConfig() if( currentServerConfig == -1) { for (int i = 1; i <= numberOfEntries; i++) { temp.setNum(i); cfg.setGroup("Server"); QString tempStr = cfg.readEntry( temp,""); } - temp.setNum( numberOfEntries + 1); cfg.setGroup("Server"); remoteServerStr = cfg.readEntry( temp,""); int divider = remoteServerStr.length() - remoteServerStr.find(":",0,TRUE); remoteServerStr = remoteServerStr.left(remoteServerStr.length()-divider); |