summaryrefslogtreecommitdiff
path: root/noncore/net/mail/editaccounts.cpp
authoralwin <alwin>2004-03-06 03:17:38 (UTC)
committer alwin <alwin>2004-03-06 03:17:38 (UTC)
commit5b49d47174925c1e2415641b77269b753688f5f1 (patch) (side-by-side diff)
tree136274f2c46ef95ea16fc1241acb5ee93931767a /noncore/net/mail/editaccounts.cpp
parentdcddc2bbe09153468a5d994c64011a5dc175baad (diff)
downloadopie-5b49d47174925c1e2415641b77269b753688f5f1.zip
opie-5b49d47174925c1e2415641b77269b753688f5f1.tar.gz
opie-5b49d47174925c1e2415641b77269b753688f5f1.tar.bz2
removed dependies to libetpan from the frontend and some stuff more
Diffstat (limited to 'noncore/net/mail/editaccounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/editaccounts.cpp36
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 @@
#include <libmailwrapper/nntpwrapper.h>
-#include <libetpan/nntpdriver.h>
-
AccountListItem::AccountListItem( QListView *parent, Account *a)
: QListViewItem( parent )
{
@@ -503,23 +501,17 @@ 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->setOn( true );
- }
- }
+ QStringList list = tmp->listAllNewsgroups();
+
+ ListViewGroups->clear();
+
+ for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ QCheckListItem *item;
+ item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );
+ if ( subscribedGroups.contains( (*it) ) >= 1 ) {
+ item->setOn( true );
+ }
+ }
}
void NNTPconfig::slotSSL( bool enabled )
@@ -544,6 +536,12 @@ void NNTPconfig::fillValues()
userLine->setText( data->getUser() );
passLine->setText( data->getPassword() );
subscribedGroups = data->getGroups();
+ /* don't forget that - you will overwrite values if user clicks cancel! */
+ for ( QStringList::Iterator it = subscribedGroups.begin(); it != subscribedGroups.end(); ++it ) {
+ QCheckListItem *item;
+ item = new QCheckListItem( ListViewGroups, (*it), QCheckListItem::CheckBox );
+ item->setOn( true );
+ }
}
void NNTPconfig::save()