Diffstat (limited to 'noncore/net/mail/libmailwrapper/mailstatics.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailstatics.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/noncore/net/mail/libmailwrapper/mailstatics.cpp b/noncore/net/mail/libmailwrapper/mailstatics.cpp index 4878dc9..033ec28 100644 --- a/noncore/net/mail/libmailwrapper/mailstatics.cpp +++ b/noncore/net/mail/libmailwrapper/mailstatics.cpp | |||
@@ -1,26 +1,27 @@ | |||
1 | #include "mailstatics.h" | 1 | #include "mailstatics.h" |
2 | #include <libetpan/libetpan.h> | 2 | #include <libetpan/libetpan.h> |
3 | #include <qpe/timestring.h> | 3 | //#include <qpe/timestring.h> |
4 | 4 | ||
5 | QString MailStatics::parseDateTime(const mailimf_date_time *date ) | 5 | QDateTime MailStatics::parseDateTime(const mailimf_date_time *date,int&offset ) |
6 | { | 6 | { |
7 | if (!date) return ""; | 7 | offset = 0; |
8 | if (!date) { | ||
9 | return QDateTime(); | ||
10 | } | ||
8 | QDateTime da(QDate(date->dt_year,date->dt_month,date->dt_day),QTime(date->dt_hour,date->dt_min,date->dt_sec)); | 11 | QDateTime da(QDate(date->dt_year,date->dt_month,date->dt_day),QTime(date->dt_hour,date->dt_min,date->dt_sec)); |
9 | QString timestring = TimeString::numberDateString(QDate(date->dt_year,date->dt_month,date->dt_day))+" "; | 12 | offset = date->dt_zone; |
10 | timestring+=TimeString::timeString(QTime(date->dt_hour,date->dt_min,date->dt_sec))+" "; | 13 | return da; |
11 | timestring.sprintf(timestring+" %+05i",date->dt_zone); | ||
12 | return timestring; | ||
13 | } | 14 | } |
14 | 15 | ||
15 | QString MailStatics::parseDateTime(const char*date) | 16 | QDateTime MailStatics::parseDateTime(const char*date,int&offset) |
16 | { | 17 | { |
17 | mailimf_date_time * date_time; | 18 | mailimf_date_time * date_time=0; |
18 | QString d = ""; | 19 | QDateTime d; |
19 | size_t cur_tok = 0; | 20 | size_t cur_tok = 0; |
20 | if (!date) return d; | 21 | if (!date) return d; |
21 | int r = mailimf_date_time_parse(date,strlen(date),&cur_tok,&date_time); | 22 | int r = mailimf_date_time_parse(date,strlen(date),&cur_tok,&date_time); |
22 | if (r==MAILIMF_NO_ERROR) { | 23 | if (r==MAILIMF_NO_ERROR) { |
23 | d = parseDateTime(date_time); | 24 | d = parseDateTime(date_time,offset); |
24 | } | 25 | } |
25 | if (date_time) { | 26 | if (date_time) { |
26 | mailimf_date_time_free(date_time); | 27 | mailimf_date_time_free(date_time); |