Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 36 |
1 files changed, 17 insertions, 19 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 | |||
16 | AccountListItem::AccountListItem( QListView *parent, Account *a) | 14 | AccountListItem::AccountListItem( QListView *parent, Account *a) |
17 | : QListViewItem( parent ) | 15 | : QListViewItem( parent ) |
18 | { | 16 | { |
@@ -503,23 +501,17 @@ 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 | 505 | ||
508 | clistcell *current; | 506 | ListViewGroups->clear(); |
509 | newsnntp_group_description *group; | 507 | |
510 | 508 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { | |
511 | // FIXME - test if not empty | 509 | QCheckListItem *item; |
512 | current = list->first; | 510 | item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox ); |
513 | for ( current=clist_begin(list);current!=NULL;current=clist_next(current) ) { | 511 | if ( subscribedGroups.contains( (*it) ) >= 1 ) { |
514 | group = ( newsnntp_group_description* ) current->data; | 512 | item->setOn( true ); |
515 | // qDebug( group->grp_name ); | 513 | } |
516 | 514 | } | |
517 | QCheckListItem *item; | ||
518 | item = new QCheckListItem( ListViewGroups, ( QString )group->grp_name, QCheckListItem::CheckBox ); | ||
519 | if ( subscribedGroups.contains( ( QString )group->grp_name ) >= 1 ) { | ||
520 | item->setOn( true ); | ||
521 | } | ||
522 | } | ||
523 | } | 515 | } |
524 | 516 | ||
525 | void NNTPconfig::slotSSL( bool enabled ) | 517 | void NNTPconfig::slotSSL( bool enabled ) |
@@ -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 | ||
549 | void NNTPconfig::save() | 547 | void NNTPconfig::save() |