summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/genericwrapper.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/genericwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
index 1caa375..5ec9415 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
@@ -1,17 +1,19 @@
1#include "genericwrapper.h" 1#include "genericwrapper.h"
2#include <libetpan/libetpan.h> 2#include <libetpan/libetpan.h>
3#include "mailtypes.h" 3#include "mailtypes.h"
4 4
5#include <opie2/odebug.h> 5#include <opie2/odebug.h>
6#include <qpe/timestring.h>
7#include <qdatetime.h>
6 8
7using namespace Opie::Core; 9using namespace Opie::Core;
8Genericwrapper::Genericwrapper() 10Genericwrapper::Genericwrapper()
9 : AbstractMail() 11 : AbstractMail()
10{ 12{
11 bodyCache.clear(); 13 bodyCache.clear();
12 m_storage = 0; 14 m_storage = 0;
13 m_folder = 0; 15 m_folder = 0;
14} 16}
15 17
16Genericwrapper::~Genericwrapper() 18Genericwrapper::~Genericwrapper()
17{ 19{
@@ -234,30 +236,29 @@ RecBodyP Genericwrapper::parseMail( mailmessage * msg )
234 /* is bound to msg and will be freed there */ 236 /* is bound to msg and will be freed there */
235 mailmime * mime=0; 237 mailmime * mime=0;
236 RecBodyP body = new RecBody(); 238 RecBodyP body = new RecBody();
237 memset(&fields, 0, sizeof(struct mailmime_single_fields)); 239 memset(&fields, 0, sizeof(struct mailmime_single_fields));
238 err = mailmessage_get_bodystructure(msg,&mime); 240 err = mailmessage_get_bodystructure(msg,&mime);
239 QValueList<int>recList; 241 QValueList<int>recList;
240 traverseBody(body,msg,mime,recList); 242 traverseBody(body,msg,mime,recList);
241 return body; 243 return body;
242} 244}
243 245
244QString Genericwrapper::parseDateTime( mailimf_date_time *date ) 246QString Genericwrapper::parseDateTime( mailimf_date_time *date )
245{ 247{
246 char tmp[23]; 248 QDateTime da(QDate(date->dt_year,date->dt_month,date->dt_day),QTime(date->dt_hour,date->dt_min,date->dt_sec));
247 249 QString timestring = TimeString::numberDateString(QDate(date->dt_year,date->dt_month,date->dt_day))+" ";
248 snprintf( tmp, 23, "%02i.%02i.%04i %02i:%02i:%02i %+05i", 250 timestring+=TimeString::timeString(QTime(date->dt_hour,date->dt_min,date->dt_sec))+" ";
249 date->dt_day, date->dt_month, date->dt_year, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); 251 timestring.sprintf(timestring+" %+05i",date->dt_zone);
250 252 return timestring;
251 return QString( tmp );
252} 253}
253 254
254QString Genericwrapper::parseAddressList( mailimf_address_list *list ) 255QString Genericwrapper::parseAddressList( mailimf_address_list *list )
255{ 256{
256 QString result( "" ); 257 QString result( "" );
257 258
258 bool first = true; 259 bool first = true;
259 if (list == 0) return result; 260 if (list == 0) return result;
260 for ( clistiter *current = clist_begin( list->ad_list ); current != NULL; current = current->next ) { 261 for ( clistiter *current = clist_begin( list->ad_list ); current != NULL; current = current->next ) {
261 mailimf_address *addr = (mailimf_address *) current->data; 262 mailimf_address *addr = (mailimf_address *) current->data;
262 263
263 if ( !first ) { 264 if ( !first ) {