summaryrefslogtreecommitdiff
path: root/noncore/net/mail/editaccounts.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/editaccounts.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp
index b8aad11..28d531b 100644
--- a/noncore/net/mail/editaccounts.cpp
+++ b/noncore/net/mail/editaccounts.cpp
@@ -11,8 +11,6 @@
11 11
12#include <libmailwrapper/nntpwrapper.h> 12#include <libmailwrapper/nntpwrapper.h>
13 13
14#include <libetpan/nntpdriver.h>
15
16AccountListItem::AccountListItem( QListView *parent, Account *a) 14AccountListItem::AccountListItem( QListView *parent, Account *a)
17 : QListViewItem( parent ) 15 : QListViewItem( parent )
18{ 16{
@@ -503,20 +501,14 @@ void NNTPconfig::slotGetNG() {
503 save(); 501 save();
504 data->save(); 502 data->save();
505 NNTPwrapper* tmp = new NNTPwrapper( data ); 503 NNTPwrapper* tmp = new NNTPwrapper( data );
506 clist* list = tmp->listAllNewsgroups(); 504 QStringList list = tmp->listAllNewsgroups();
507
508 clistcell *current;
509 newsnntp_group_description *group;
510 505
511 // FIXME - test if not empty 506 ListViewGroups->clear();
512 current = list->first;
513 for ( current=clist_begin(list);current!=NULL;current=clist_next(current) ) {
514 group = ( newsnntp_group_description* ) current->data;
515 // qDebug( group->grp_name );
516 507
508 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
517 QCheckListItem *item; 509 QCheckListItem *item;
518 item = new QCheckListItem( ListViewGroups, ( QString )group->grp_name, QCheckListItem::CheckBox ); 510 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );
519 if ( subscribedGroups.contains( ( QString )group->grp_name ) >= 1 ) { 511 if ( subscribedGroups.contains( (*it) ) >= 1 ) {
520 item->setOn( true ); 512 item->setOn( true );
521 } 513 }
522 } 514 }
@@ -544,6 +536,12 @@ void NNTPconfig::fillValues()
544 userLine->setText( data->getUser() ); 536 userLine->setText( data->getUser() );
545 passLine->setText( data->getPassword() ); 537 passLine->setText( data->getPassword() );
546 subscribedGroups = data->getGroups(); 538 subscribedGroups = data->getGroups();
539 /* don't forget that - you will overwrite values if user clicks cancel! */
540 for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) {
541 QCheckListItem *item;
542 item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );
543 item->setOn( true );
544 }
547} 545}
548 546
549void NNTPconfig::save() 547void NNTPconfig::save()