Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.cpp | 35 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.h | 2 |
2 files changed, 23 insertions, 14 deletions
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 | |||
@@ -201,22 +201,31 @@ QList<Folder>* NNTPwrapper::listFolders() { | |||
201 | } | 201 | } |
202 | return folders; | 202 | return folders; |
203 | } | 203 | } |
204 | 204 | ||
205 | clist * NNTPwrapper::listAllNewsgroups() { | 205 | QStringList 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; |
210 | if ( m_nntp ) { | 211 | |
211 | mailsession * session = m_nntp->sto_session; | 212 | if ( m_nntp ) { |
212 | newsnntp * news = ( ( nntp_session_state_data * )session->sess_data )->nntp_session; | 213 | mailsession * session = m_nntp->sto_session; |
213 | int err = newsnntp_list_newsgroups(news, NULL, &result); | 214 | newsnntp * news = ( ( nntp_session_state_data * )session->sess_data )->nntp_session; |
214 | 215 | int err = newsnntp_list_newsgroups(news, NULL, &result); | |
215 | if ( err == NEWSNNTP_NO_ERROR ) { | 216 | if ( err == NEWSNNTP_NO_ERROR && result) { |
216 | return result; | 217 | for ( current=clist_begin(result);current!=NULL;current=clist_next(current) ) { |
217 | } | 218 | group = ( newsnntp_group_description* ) current->data; |
218 | } | 219 | if (!group||!group->grp_name||strlen(group->grp_name)==0) continue; |
220 | res.append(group->grp_name); | ||
221 | } | ||
222 | } | ||
223 | } | ||
224 | if (result) { | ||
225 | clist_free(result); | ||
226 | } | ||
227 | return res; | ||
219 | } | 228 | } |
220 | 229 | ||
221 | void NNTPwrapper::answeredMail(const RecMail&) {} | 230 | void NNTPwrapper::answeredMail(const RecMail&) {} |
222 | 231 | ||
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 | |||
@@ -24,9 +24,9 @@ public: | |||
24 | /* should only get the subscribed one */ | 24 | /* should only get the subscribed one */ |
25 | virtual QList<Folder>* listFolders(); | 25 | virtual QList<Folder>* listFolders(); |
26 | /* mailbox will be ignored */ | 26 | /* mailbox will be ignored */ |
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); |
30 | virtual void answeredMail(const RecMail&mail); | 30 | virtual void answeredMail(const RecMail&mail); |
31 | virtual int deleteAllMail(const Folder*); | 31 | virtual int deleteAllMail(const Folder*); |
32 | 32 | ||