-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 11 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.cpp | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp index 215380d..b8aad11 100644 --- a/noncore/net/mail/editaccounts.cpp +++ b/noncore/net/mail/editaccounts.cpp @@ -496,80 +496,83 @@ NNTPconfig::NNTPconfig( NNTPaccount *account, QWidget *parent, const char *name, connect( GetNGButton, SIGNAL( clicked() ), this, SLOT( slotGetNG() ) ); fillValues(); connect( sslBox, SIGNAL( toggled(bool) ), SLOT( slotSSL(bool) ) ); } void NNTPconfig::slotGetNG() { save(); data->save(); NNTPwrapper* tmp = new NNTPwrapper( data ); clist* list = tmp->listAllNewsgroups(); clistcell *current; newsnntp_group_description *group; // FIXME - test if not empty current = list->first; for ( current=clist_begin(list);current!=NULL;current=clist_next(current) ) { group = ( newsnntp_group_description* ) current->data; // qDebug( group->grp_name ); QCheckListItem *item; item = new QCheckListItem( ListViewGroups, ( QString )group->grp_name, QCheckListItem::CheckBox ); if ( subscribedGroups.contains( ( QString )group->grp_name ) >= 1 ) { - item->setSelected( true ); + item->setOn( true ); } } } void NNTPconfig::slotSSL( bool enabled ) { if ( enabled ) { portLine->setText( NNTP_SSL_PORT ); } else { portLine->setText( NNTP_PORT ); } } void NNTPconfig::fillValues() { accountLine->setText( data->getAccountName() ); serverLine->setText( data->getServer() ); portLine->setText( data->getPort() ); sslBox->setChecked( data->getSSL() ); loginBox->setChecked( data->getLogin() ); userLine->setText( data->getUser() ); passLine->setText( data->getPassword() ); subscribedGroups = data->getGroups(); } void NNTPconfig::save() { data->setAccountName( accountLine->text() ); data->setServer( serverLine->text() ); data->setPort( portLine->text() ); data->setSSL( sslBox->isChecked() ); data->setLogin( loginBox->isChecked() ); data->setUser( userLine->text() ); data->setPassword( passLine->text() ); QListViewItemIterator list_it( ListViewGroups ); - for ( ; list_it.current(); ++list_it ) { + QStringList groupList; - if ( list_it.current()->isSelected() ) { + for ( ; list_it.current(); ++list_it ) { + + if ( ( (QCheckListItem*)list_it.current() )->isOn() ) { qDebug(list_it.current()->text(0) ); groupList.append( list_it.current()->text(0) ); } - data->setGroups( groupList ); + } + data->setGroups( groupList ); } void NNTPconfig::accept() { save(); QDialog::accept(); } diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp index 2d6f9a3..ecdf848 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp @@ -103,49 +103,49 @@ void NNTPwrapper::listMessages(const QString &, QList<RecMail> &target ) return; uint32_t res_messages,res_recent,res_unseen; mailsession_status_folder(m_nntp->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); parseList(target,m_nntp->sto_session,"INBOX"); } void NNTPwrapper::login() { if (account->getOffline()) return; /* we'll hold the line */ if ( m_nntp != NULL ) return; const char *server, *user, *pass; QString User,Pass; uint16_t port; int err = NEWSNNTP_NO_ERROR; server = account->getServer().latin1(); port = account->getPort().toUInt(); user = pass = 0; - if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { + if ( ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) && account->getLogin() ) { LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); login.show(); if ( QDialog::Accepted == login.exec() ) { // ok User = login.getUser().latin1(); Pass = login.getPassword().latin1(); } else { // cancel qDebug( "NNTP: Login canceled" ); return; } } else { User = account->getUser().latin1(); Pass = account->getPassword().latin1(); } if (User.isEmpty()) { user=0; pass = 0; } else { user=User.latin1(); pass=Pass.latin1(); } // bool ssl = account->getSSL(); |