-rw-r--r-- | noncore/net/mail/libmailwrapper/libmailwrapper.pro | 6 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailstatics.cpp | 29 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailstatics.h | 19 |
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 | |||
@@ -1,58 +1,60 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | 3 | ||
4 | HEADERS = mailwrapper.h \ | 4 | HEADERS = mailwrapper.h \ |
5 | imapwrapper.h \ | 5 | imapwrapper.h \ |
6 | mailtypes.h \ | 6 | mailtypes.h \ |
7 | pop3wrapper.h \ | 7 | pop3wrapper.h \ |
8 | abstractmail.h \ | 8 | abstractmail.h \ |
9 | smtpwrapper.h \ | 9 | smtpwrapper.h \ |
10 | genericwrapper.h \ | 10 | genericwrapper.h \ |
11 | mboxwrapper.h \ | 11 | mboxwrapper.h \ |
12 | settings.h \ | 12 | settings.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 | ||
21 | SOURCES = imapwrapper.cpp \ | 22 | SOURCES = 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 \ |
26 | smtpwrapper.cpp \ | 27 | smtpwrapper.cpp \ |
27 | genericwrapper.cpp \ | 28 | genericwrapper.cpp \ |
28 | mboxwrapper.cpp \ | 29 | mboxwrapper.cpp \ |
29 | settings.cpp \ | 30 | settings.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 | ||
38 | INTERFACES = logindialogui.ui \ | 40 | INTERFACES = logindialogui.ui \ |
39 | sendmailprogressui.ui | 41 | sendmailprogressui.ui |
40 | 42 | ||
41 | INCLUDEPATH += $(OPIEDIR)/include | 43 | INCLUDEPATH += $(OPIEDIR)/include |
42 | LIBS += -lqpe -letpan -lssl -lcrypto | 44 | LIBS += -lqpe -letpan -lssl -lcrypto |
43 | 45 | ||
44 | contains( $(CONFIG_TARGET_MACOSX), y ){ | 46 | contains( $(CONFIG_TARGET_MACOSX), y ){ |
45 | LIBS += -liconv | 47 | LIBS += -liconv |
46 | } | 48 | } |
47 | 49 | ||
48 | DESTDIR = $(OPIEDIR)/lib | 50 | DESTDIR = $(OPIEDIR)/lib |
49 | TARGET = mailwrapper | 51 | TARGET = mailwrapper |
50 | 52 | ||
51 | include ( $(OPIEDIR)/include.pro ) | 53 | include ( $(OPIEDIR)/include.pro ) |
52 | 54 | ||
53 | !isEmpty( LIBETPAN_INC_DIR ) { | 55 | !isEmpty( LIBETPAN_INC_DIR ) { |
54 | INCLUDEPATH = $$LIBETPAN_INC_DIR $$INCLUDEPATH | 56 | INCLUDEPATH = $$LIBETPAN_INC_DIR $$INCLUDEPATH |
55 | } | 57 | } |
56 | !isEmpty( LIBETPAN_LIB_DIR ) { | 58 | !isEmpty( LIBETPAN_LIB_DIR ) { |
57 | LIBS = -L$$LIBETPAN_LIB_DIR $$LIBS | 59 | LIBS = -L$$LIBETPAN_LIB_DIR $$LIBS |
58 | } | 60 | } |
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 | |||
5 | QString 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 | |||
15 | QString 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 | |||
7 | struct mailimf_date_time; | ||
8 | |||
9 | class MailStatics | ||
10 | { | ||
11 | protected: | ||
12 | static QString parseDateTime(const mailimf_date_time * date); | ||
13 | static QString parseDateTime(const char*date); | ||
14 | MailStatics(){}; | ||
15 | virtual ~MailStatics(){}; | ||
16 | public: | ||
17 | }; | ||
18 | |||
19 | #endif | ||