summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/libmailwrapper.pro6
-rw-r--r--noncore/net/mail/libmailwrapper/mailstatics.cpp29
-rw-r--r--noncore/net/mail/libmailwrapper/mailstatics.h19
3 files changed, 52 insertions, 2 deletions
diff --git a/noncore/net/mail/libmailwrapper/libmailwrapper.pro b/noncore/net/mail/libmailwrapper/libmailwrapper.pro
index befadd7..dd9efcb 100644
--- a/noncore/net/mail/libmailwrapper/libmailwrapper.pro
+++ b/noncore/net/mail/libmailwrapper/libmailwrapper.pro
@@ -13,13 +13,14 @@ HEADERS = mailwrapper.h \
13 logindialog.h \ 13 logindialog.h \
14 sendmailprogress.h \ 14 sendmailprogress.h \
15 statusmail.h \ 15 statusmail.h \
16 mhwrapper.h \ 16 mhwrapper.h \
17 nntpwrapper.h \ 17 nntpwrapper.h \
18 generatemail.h \ 18 generatemail.h \
19 storemail.h 19 storemail.h \
20 mailstatics.h
20 21
21SOURCES = imapwrapper.cpp \ 22SOURCES = imapwrapper.cpp \
22 mailwrapper.cpp \ 23 mailwrapper.cpp \
23 mailtypes.cpp \ 24 mailtypes.cpp \
24 pop3wrapper.cpp \ 25 pop3wrapper.cpp \
25 abstractmail.cpp \ 26 abstractmail.cpp \
@@ -30,13 +31,14 @@ SOURCES = imapwrapper.cpp \
30 logindialog.cpp \ 31 logindialog.cpp \
31 sendmailprogress.cpp \ 32 sendmailprogress.cpp \
32 statusmail.cpp \ 33 statusmail.cpp \
33 mhwrapper.cpp \ 34 mhwrapper.cpp \
34 nntpwrapper.cpp \ 35 nntpwrapper.cpp \
35 generatemail.cpp \ 36 generatemail.cpp \
36 storemail.cpp 37 storemail.cpp \
38 mailstatics.cpp
37 39
38INTERFACES = logindialogui.ui \ 40INTERFACES = logindialogui.ui \
39 sendmailprogressui.ui 41 sendmailprogressui.ui
40 42
41INCLUDEPATH += $(OPIEDIR)/include 43INCLUDEPATH += $(OPIEDIR)/include
42LIBS += -lqpe -letpan -lssl -lcrypto 44LIBS += -lqpe -letpan -lssl -lcrypto
diff --git a/noncore/net/mail/libmailwrapper/mailstatics.cpp b/noncore/net/mail/libmailwrapper/mailstatics.cpp
new file mode 100644
index 0000000..4878dc9
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/mailstatics.cpp
@@ -0,0 +1,29 @@
1#include "mailstatics.h"
2#include <libetpan/libetpan.h>
3#include <qpe/timestring.h>
4
5QString MailStatics::parseDateTime(const mailimf_date_time *date )
6{
7 if (!date) return "";
8 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))+" ";
10 timestring+=TimeString::timeString(QTime(date->dt_hour,date->dt_min,date->dt_sec))+" ";
11 timestring.sprintf(timestring+" %+05i",date->dt_zone);
12 return timestring;
13}
14
15QString MailStatics::parseDateTime(const char*date)
16{
17 mailimf_date_time * date_time;
18 QString d = "";
19 size_t cur_tok = 0;
20 if (!date) return d;
21 int r = mailimf_date_time_parse(date,strlen(date),&cur_tok,&date_time);
22 if (r==MAILIMF_NO_ERROR) {
23 d = parseDateTime(date_time);
24 }
25 if (date_time) {
26 mailimf_date_time_free(date_time);
27 }
28 return d;
29} \ No newline at end of file
diff --git a/noncore/net/mail/libmailwrapper/mailstatics.h b/noncore/net/mail/libmailwrapper/mailstatics.h
new file mode 100644
index 0000000..841d14d
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/mailstatics.h
@@ -0,0 +1,19 @@
1#ifndef __MAIL_STATICS_H
2#define __MAIL_STATICS_H
3
4#include <qdatetime.h>
5#include <qstring.h>
6
7struct mailimf_date_time;
8
9class MailStatics
10{
11protected:
12 static QString parseDateTime(const mailimf_date_time * date);
13 static QString parseDateTime(const char*date);
14 MailStatics(){};
15 virtual ~MailStatics(){};
16public:
17};
18
19#endif