author | harlekin <harlekin> | 2004-02-29 23:19:13 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-02-29 23:19:13 (UTC) |
commit | 47cb805563e76732320f082975aad3046be1992a (patch) (unidiff) | |
tree | c7dc988659c47166370dfd93d9140d4919c944da /noncore/net | |
parent | dcf152e23f7cc85fe2e46521e07b64e2288efdda (diff) | |
download | opie-47cb805563e76732320f082975aad3046be1992a.zip opie-47cb805563e76732320f082975aad3046be1992a.tar.gz opie-47cb805563e76732320f082975aad3046be1992a.tar.bz2 |
little update
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.cpp | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp index e73a890..c68964d 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp | |||
@@ -157,15 +157,17 @@ void NNTPwrapper::login() | |||
157 | } | 157 | } |
158 | 158 | ||
159 | nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, conntype, NNTP_AUTH_TYPE_PLAIN, | 159 | nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, conntype, NNTP_AUTH_TYPE_PLAIN, |
160 | (char*)user,(char*)pass,0,0,0); | 160 | (char*)user,(char*)pass,0,0,0); |
161 | 161 | ||
162 | err = mailstorage_connect(m_nntp); | 162 | err = mailstorage_connect( m_nntp ); |
163 | 163 | ||
164 | if (err != NEWSNNTP_NO_ERROR) { | 164 | if (err != NEWSNNTP_NO_ERROR) { |
165 | qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); | 165 | qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); |
166 | // Global::statusMessage(tr("Error initializing folder")); | 166 | // Global::statusMessage(tr("Error initializing folder")); |
167 | mailstorage_free(m_nntp); | 167 | mailstorage_free(m_nntp); |
168 | m_nntp = 0; | 168 | m_nntp = 0; |
169 | |||
169 | } | 170 | } |
171 | |||
170 | } | 172 | } |
171 | 173 | ||
@@ -176,21 +178,33 @@ void NNTPwrapper::logout() | |||
176 | return; | 178 | return; |
177 | mailstorage_free(m_nntp); | 179 | mailstorage_free(m_nntp); |
178 | m_nntp = 0; | 180 | m_nntp = 0; |
179 | } | 181 | } |
180 | 182 | ||
181 | QList<Folder>* NNTPwrapper::listFolders() { | 183 | QList<Folder>* NNTPwrapper::listFolders() { |
182 | QList<Folder> * folders = new QList<Folder>(); | ||
183 | folders->setAutoDelete( false ); | ||
184 | clist *result = 0; | ||
185 | 184 | ||
186 | // int err = | ||
187 | // if ( err == _NO_ERROR ) { | ||
188 | // current = result->first; | ||
189 | // for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { | ||
190 | 185 | ||
191 | 186 | ||
192 | // Folder*inb=new Folder("INBOX","/"); | ||
193 | |||
194 | 187 | ||
188 | QList<Folder> * folders = new QList<Folder>(); | ||
189 | folders->setAutoDelete( false ); | ||
190 | clist *result = 0; | ||
191 | clistcell *current; | ||
192 | newsnntp_group_description *list; | ||
193 | |||
194 | login(); | ||
195 | if ( m_nntp ) { | ||
196 | mailsession * session = m_nntp->sto_session; | ||
197 | newsnntp * news = ( ( nntp_session_state_data * )session->sess_data )->nntp_session; | ||
198 | int err = newsnntp_list_newsgroups(news, NULL, &result); | ||
199 | |||
200 | if ( err == NEWSNNTP_NO_ERROR ) { | ||
201 | current = result->first; | ||
202 | for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { | ||
203 | list = ( newsnntp_group_description* ) current->data; | ||
204 | qDebug( list->grp_name ); | ||
205 | } | ||
206 | // Folder*inb=new Folder("INBOX","/"); | ||
207 | } | ||
208 | } | ||
195 | // folders->append(inb); | 209 | // folders->append(inb); |
196 | return folders; | 210 | return folders; |