summaryrefslogtreecommitdiff
path: root/noncore/net
Unidiff
Diffstat (limited to 'noncore/net') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/editaccounts.cpp24
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.cpp21
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.h2
3 files changed, 27 insertions, 20 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
@@ -13,4 +13,2 @@
13 13
14#include <libetpan/nntpdriver.h>
15
16AccountListItem::AccountListItem( QListView *parent, Account *a) 14AccountListItem::AccountListItem( QListView *parent, Account *a)
@@ -505,16 +503,10 @@ void NNTPconfig::slotGetNG() {
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 );
@@ -546,2 +538,8 @@ void NNTPconfig::fillValues()
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}
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
index 798879d..a766a59 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
@@ -204,7 +204,9 @@ QList<Folder>* NNTPwrapper::listFolders() {
204 204
205 clist * NNTPwrapper::listAllNewsgroups() { 205QStringList NNTPwrapper::listAllNewsgroups() {
206 login(); 206 login();
207 QStringList res;
207 clist *result = 0; 208 clist *result = 0;
208 clistcell *current; 209 clistcell *current = 0;
209 newsnntp_group_description *list; 210 newsnntp_group_description *group;
211
210 if ( m_nntp ) { 212 if ( m_nntp ) {
@@ -213,7 +215,14 @@ QList<Folder>* NNTPwrapper::listFolders() {
213 int err = newsnntp_list_newsgroups(news, NULL, &result); 215 int err = newsnntp_list_newsgroups(news, NULL, &result);
214 216 if ( err == NEWSNNTP_NO_ERROR && result) {
215 if ( err == NEWSNNTP_NO_ERROR ) { 217 for ( current=clist_begin(result);current!=NULL;current=clist_next(current) ) {
216 return result; 218 group = ( newsnntp_group_description* ) current->data;
219 if (!group||!group->grp_name||strlen(group->grp_name)==0) continue;
220 res.append(group->grp_name);
221 }
217 } 222 }
218 } 223 }
224 if (result) {
225 clist_free(result);
226 }
227 return res;
219} 228}
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.h b/noncore/net/mail/libmailwrapper/nntpwrapper.h
index e8e2cf4..4d03754 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.h
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.h
@@ -27,3 +27,3 @@ public:
27 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 27 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
28 clist * listAllNewsgroups(); 28 QStringList listAllNewsgroups();
29 virtual void deleteMail(const RecMail&mail); 29 virtual void deleteMail(const RecMail&mail);