Diffstat (limited to 'noncore/net/mail/libmailwrapper/genericwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/genericwrapper.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp index 6c8a5a1..ee2c8cd 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp | |||
@@ -322,41 +322,41 @@ QString Genericwrapper::parseMailboxList( mailimf_mailbox_list *list ) | |||
322 | if ( !first ) { | 322 | if ( !first ) { |
323 | result.append( "," ); | 323 | result.append( "," ); |
324 | } else { | 324 | } else { |
325 | first = false; | 325 | first = false; |
326 | } | 326 | } |
327 | 327 | ||
328 | result.append( parseMailbox( box ) ); | 328 | result.append( parseMailbox( box ) ); |
329 | } | 329 | } |
330 | 330 | ||
331 | return result; | 331 | return result; |
332 | } | 332 | } |
333 | 333 | ||
334 | encodedString* Genericwrapper::fetchDecodedPart(const RecMail&,const RecPart&part) | 334 | encodedString* Genericwrapper::fetchDecodedPart(const RecMailP&,const RecPart&part) |
335 | { | 335 | { |
336 | QMap<QString,encodedString*>::ConstIterator it = bodyCache.find(part.Identifier()); | 336 | QMap<QString,encodedString*>::ConstIterator it = bodyCache.find(part.Identifier()); |
337 | if (it==bodyCache.end()) return new encodedString(); | 337 | if (it==bodyCache.end()) return new encodedString(); |
338 | encodedString*t = decode_String(it.data(),part.Encoding()); | 338 | encodedString*t = decode_String(it.data(),part.Encoding()); |
339 | return t; | 339 | return t; |
340 | } | 340 | } |
341 | 341 | ||
342 | encodedString* Genericwrapper::fetchRawPart(const RecMail&mail,const RecPart&part) | 342 | encodedString* Genericwrapper::fetchRawPart(const RecMailP&mail,const RecPart&part) |
343 | { | 343 | { |
344 | QMap<QString,encodedString*>::ConstIterator it = bodyCache.find(part.Identifier()); | 344 | QMap<QString,encodedString*>::ConstIterator it = bodyCache.find(part.Identifier()); |
345 | if (it==bodyCache.end()) return new encodedString(); | 345 | if (it==bodyCache.end()) return new encodedString(); |
346 | encodedString*t = it.data(); | 346 | encodedString*t = it.data(); |
347 | return t; | 347 | return t; |
348 | } | 348 | } |
349 | 349 | ||
350 | QString Genericwrapper::fetchTextPart(const RecMail&mail,const RecPart&part) | 350 | QString Genericwrapper::fetchTextPart(const RecMailP&mail,const RecPart&part) |
351 | { | 351 | { |
352 | encodedString*t = fetchDecodedPart(mail,part); | 352 | encodedString*t = fetchDecodedPart(mail,part); |
353 | QString text=t->Content(); | 353 | QString text=t->Content(); |
354 | delete t; | 354 | delete t; |
355 | return text; | 355 | return text; |
356 | } | 356 | } |
357 | 357 | ||
358 | void Genericwrapper::cleanMimeCache() | 358 | void Genericwrapper::cleanMimeCache() |
359 | { | 359 | { |
360 | QMap<QString,encodedString*>::Iterator it = bodyCache.begin(); | 360 | QMap<QString,encodedString*>::Iterator it = bodyCache.begin(); |
361 | for (;it!=bodyCache.end();++it) { | 361 | for (;it!=bodyCache.end();++it) { |
362 | encodedString*t = it.data(); | 362 | encodedString*t = it.data(); |
@@ -378,25 +378,25 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) | |||
378 | h.remove(0,1); | 378 | h.remove(0,1); |
379 | } | 379 | } |
380 | while (h.length()>0 && h[h.length()-1]=='>') { | 380 | while (h.length()>0 && h[h.length()-1]=='>') { |
381 | h.remove(h.length()-1,1); | 381 | h.remove(h.length()-1,1); |
382 | } | 382 | } |
383 | if (h.length()>0) { | 383 | if (h.length()>0) { |
384 | res.append(h); | 384 | res.append(h); |
385 | } | 385 | } |
386 | } | 386 | } |
387 | return res; | 387 | return res; |
388 | } | 388 | } |
389 | 389 | ||
390 | void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const QString&mailbox,bool mbox_as_to) | 390 | void Genericwrapper::parseList(QValueList<Opie::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to) |
391 | { | 391 | { |
392 | int r; | 392 | int r; |
393 | mailmessage_list * env_list = 0; | 393 | mailmessage_list * env_list = 0; |
394 | r = mailsession_get_messages_list(session,&env_list); | 394 | r = mailsession_get_messages_list(session,&env_list); |
395 | if (r != MAIL_NO_ERROR) { | 395 | if (r != MAIL_NO_ERROR) { |
396 | qDebug("Error message list"); | 396 | qDebug("Error message list"); |
397 | return; | 397 | return; |
398 | } | 398 | } |
399 | r = mailsession_get_envelopes_list(session, env_list); | 399 | r = mailsession_get_envelopes_list(session, env_list); |
400 | if (r != MAIL_NO_ERROR) { | 400 | if (r != MAIL_NO_ERROR) { |
401 | qDebug("Error filling message list"); | 401 | qDebug("Error filling message list"); |
402 | if (env_list) { | 402 | if (env_list) { |
@@ -406,25 +406,25 @@ void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const | |||
406 | } | 406 | } |
407 | mailimf_references * refs = 0; | 407 | mailimf_references * refs = 0; |
408 | mailimf_in_reply_to * in_replies = 0; | 408 | mailimf_in_reply_to * in_replies = 0; |
409 | uint32_t i = 0; | 409 | uint32_t i = 0; |
410 | for(; i < carray_count(env_list->msg_tab) ; ++i) { | 410 | for(; i < carray_count(env_list->msg_tab) ; ++i) { |
411 | mailmessage * msg; | 411 | mailmessage * msg; |
412 | QBitArray mFlags(7); | 412 | QBitArray mFlags(7); |
413 | msg = (mailmessage*)carray_get(env_list->msg_tab, i); | 413 | msg = (mailmessage*)carray_get(env_list->msg_tab, i); |
414 | if (msg->msg_fields == NULL) { | 414 | if (msg->msg_fields == NULL) { |
415 | //qDebug("could not fetch envelope of message %i", i); | 415 | //qDebug("could not fetch envelope of message %i", i); |
416 | continue; | 416 | continue; |
417 | } | 417 | } |
418 | RecMail * mail = new RecMail(); | 418 | RecMailP mail = new RecMail(); |
419 | mail->setWrapper(this); | 419 | mail->setWrapper(this); |
420 | mail_flags * flag_result = 0; | 420 | mail_flags * flag_result = 0; |
421 | r = mailmessage_get_flags(msg,&flag_result); | 421 | r = mailmessage_get_flags(msg,&flag_result); |
422 | if (r == MAIL_ERROR_NOT_IMPLEMENTED) { | 422 | if (r == MAIL_ERROR_NOT_IMPLEMENTED) { |
423 | mFlags.setBit(FLAG_SEEN); | 423 | mFlags.setBit(FLAG_SEEN); |
424 | } | 424 | } |
425 | mailimf_single_fields single_fields; | 425 | mailimf_single_fields single_fields; |
426 | mailimf_single_fields_init(&single_fields, msg->msg_fields); | 426 | mailimf_single_fields_init(&single_fields, msg->msg_fields); |
427 | mail->setMsgsize(msg->msg_size); | 427 | mail->setMsgsize(msg->msg_size); |
428 | mail->setFlags(mFlags); | 428 | mail->setFlags(mFlags); |
429 | mail->setMbox(mailbox); | 429 | mail->setMbox(mailbox); |
430 | mail->setNumber(msg->msg_index); | 430 | mail->setNumber(msg->msg_index); |