-rw-r--r-- | noncore/net/mail/libmailwrapper/genericwrapper.cpp | 10 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailstatics.cpp | 23 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailstatics.h | 4 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.cpp | 18 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.h | 11 | ||||
-rw-r--r-- | noncore/net/mail/mailistviewitem.cpp | 20 | ||||
-rw-r--r-- | noncore/net/mail/mailistviewitem.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 3 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 2 |
10 files changed, 66 insertions, 31 deletions
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp index 703235d..0ac842d 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp | |||
@@ -386,3 +386,3 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > & | |||
386 | { | 386 | { |
387 | int r; | 387 | int r,toffset; |
388 | mailmessage_list * env_list = 0; | 388 | mailmessage_list * env_list = 0; |
@@ -439,5 +439,6 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > & | |||
439 | mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) ); | 439 | mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) ); |
440 | if (single_fields.fld_orig_date) | 440 | if (single_fields.fld_orig_date) { |
441 | mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) ); | 441 | QDateTime d = parseDateTime( single_fields.fld_orig_date->dt_date_time,toffset); |
442 | // crashes when accessing pop3 account? | 442 | mail->setDate( d,toffset ); |
443 | } | ||
443 | if (single_fields.fld_message_id && single_fields.fld_message_id->mid_value) { | 444 | if (single_fields.fld_message_id && single_fields.fld_message_id->mid_value) { |
@@ -445,3 +446,2 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > & | |||
445 | } | 446 | } |
446 | |||
447 | if (single_fields.fld_reply_to) { | 447 | if (single_fields.fld_reply_to) { |
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 56efa0b..8e5212b 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -374,3 +374,3 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | |||
374 | mailimap_flag_fetch*cflag; | 374 | mailimap_flag_fetch*cflag; |
375 | int size; | 375 | int size,toffset; |
376 | QBitArray mFlags(7); | 376 | QBitArray mFlags(7); |
@@ -426,3 +426,4 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | |||
426 | mailimap_envelope * head = item->att_data.att_static->att_data.att_env; | 426 | mailimap_envelope * head = item->att_data.att_static->att_data.att_env; |
427 | m->setDate(parseDateTime(head->env_date)); | 427 | QDateTime d = parseDateTime(head->env_date,toffset); |
428 | m->setDate(d,toffset); | ||
428 | m->setSubject(convert_String((const char*)head->env_subject)); | 429 | m->setSubject(convert_String((const char*)head->env_subject)); |
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 | |||
@@ -2,18 +2,19 @@ | |||
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; |
@@ -22,3 +23,3 @@ QString MailStatics::parseDateTime(const char*date) | |||
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 | } |
diff --git a/noncore/net/mail/libmailwrapper/mailstatics.h b/noncore/net/mail/libmailwrapper/mailstatics.h index 841d14d..c714ead 100644 --- a/noncore/net/mail/libmailwrapper/mailstatics.h +++ b/noncore/net/mail/libmailwrapper/mailstatics.h | |||
@@ -11,4 +11,4 @@ class MailStatics | |||
11 | protected: | 11 | protected: |
12 | static QString parseDateTime(const mailimf_date_time * date); | 12 | static QDateTime parseDateTime(const mailimf_date_time * date,int&offset); |
13 | static QString parseDateTime(const char*date); | 13 | static QDateTime parseDateTime(const char*date,int&offset); |
14 | MailStatics(){}; | 14 | MailStatics(){}; |
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp index d4395a2..b009b75 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.cpp +++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp | |||
@@ -3,2 +3,3 @@ | |||
3 | #include <opie2/odebug.h> | 3 | #include <opie2/odebug.h> |
4 | #include <qpe/timestring.h> | ||
4 | 5 | ||
@@ -8,3 +9,3 @@ using namespace Opie::Core; | |||
8 | RecMail::RecMail() | 9 | RecMail::RecMail() |
9 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) | 10 | :Opie::Core::ORefCount(),subject(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7),maildate(),date("") |
10 | { | 11 | { |
@@ -14,3 +15,3 @@ RecMail::RecMail() | |||
14 | RecMail::RecMail(const RecMail&old) | 15 | RecMail::RecMail(const RecMail&old) |
15 | :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7) | 16 | :Opie::Core::ORefCount(),subject(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7),maildate(),date("") |
16 | { | 17 | { |
@@ -29,2 +30,3 @@ void RecMail::copy_old(const RecMail&old) | |||
29 | subject = old.subject; | 30 | subject = old.subject; |
31 | maildate = old.maildate; | ||
30 | date = old.date; | 32 | date = old.date; |
@@ -55,2 +57,13 @@ void RecMail::init() | |||
55 | 57 | ||
58 | void RecMail::setDate( const QDateTime&a,int offset) | ||
59 | { | ||
60 | QString timestring = TimeString::numberDateString(a.date())+" "; | ||
61 | timestring+=TimeString::timeString(a.time()); | ||
62 | if (offset > 0) { | ||
63 | timestring.sprintf(timestring+" %+05i",offset); | ||
64 | } | ||
65 | date = timestring; | ||
66 | maildate = a; | ||
67 | } | ||
68 | |||
56 | void RecMail::setWrapper(AbstractMail*awrapper) | 69 | void RecMail::setWrapper(AbstractMail*awrapper) |
@@ -398,2 +411 @@ folderStat&folderStat::operator=(const folderStat&old) | |||
398 | } | } | |
399 | |||
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h index c317880..272514c 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.h +++ b/noncore/net/mail/libmailwrapper/mailtypes.h | |||
@@ -17,2 +17,3 @@ | |||
17 | #include <qvaluelist.h> | 17 | #include <qvaluelist.h> |
18 | #include <qdatetime.h> | ||
18 | 19 | ||
@@ -40,4 +41,2 @@ public: | |||
40 | void setNumber(unsigned int number){msg_number=number;} | 41 | void setNumber(unsigned int number){msg_number=number;} |
41 | const QString&getDate()const{ return date; } | ||
42 | void setDate( const QString&a ) { date = a; } | ||
43 | const QString&getFrom()const{ return from; } | 42 | const QString&getFrom()const{ return from; } |
@@ -73,4 +72,8 @@ public: | |||
73 | 72 | ||
73 | const QDateTime&getDate()const{ return maildate; } | ||
74 | const QString&getStringDate()const{return date;} | ||
75 | void setDate( const QDateTime&a,int offset=0 ); | ||
76 | |||
74 | protected: | 77 | protected: |
75 | QString subject,date,from,mbox,msg_id,replyto; | 78 | QString subject,from,mbox,msg_id,replyto; |
76 | unsigned int msg_number,msg_size; | 79 | unsigned int msg_number,msg_size; |
@@ -81,2 +84,4 @@ protected: | |||
81 | void copy_old(const RecMail&old); | 84 | void copy_old(const RecMail&old); |
85 | QDateTime maildate; | ||
86 | QString date; | ||
82 | }; | 87 | }; |
diff --git a/noncore/net/mail/mailistviewitem.cpp b/noncore/net/mail/mailistviewitem.cpp index 0b926da..d3a0723 100644 --- a/noncore/net/mail/mailistviewitem.cpp +++ b/noncore/net/mail/mailistviewitem.cpp | |||
@@ -4,2 +4,3 @@ | |||
4 | #include <qpe/resource.h> | 4 | #include <qpe/resource.h> |
5 | #include <qpe/timestring.h> | ||
5 | 6 | ||
@@ -15,3 +16,3 @@ void MailListViewItem::showEntry() | |||
15 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { | 16 | } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { |
16 | /* I think it looks nicer if there are not such a log of icons but only on mails | 17 | /* I think it looks nicer if there are not such a lot of icons but only on mails |
17 | replied or new - Alwin*/ | 18 | replied or new - Alwin*/ |
@@ -50,3 +51,2 @@ void MailListViewItem::showEntry() | |||
50 | } | 51 | } |
51 | |||
52 | setText(1,mail_data->getSubject()); | 52 | setText(1,mail_data->getSubject()); |
@@ -54,3 +54,17 @@ void MailListViewItem::showEntry() | |||
54 | setText(3,fsize); | 54 | setText(3,fsize); |
55 | setText(4,mail_data->getDate()); | 55 | setText(4,mail_data->getStringDate()); |
56 | } | ||
57 | |||
58 | QString MailListViewItem::key(int col,bool) const | ||
59 | { | ||
60 | QString temp; | ||
61 | if (col == 4) { | ||
62 | temp.sprintf( "%08d",QDateTime().secsTo(mail_data->getDate())); | ||
63 | return temp; | ||
64 | } | ||
65 | if (col == 3) { | ||
66 | temp.sprintf( "%020d",mail_data->Msgsize()); | ||
67 | return temp; | ||
68 | } | ||
69 | return text(col); | ||
56 | } | 70 | } |
diff --git a/noncore/net/mail/mailistviewitem.h b/noncore/net/mail/mailistviewitem.h index d953d83..ce64ca9 100644 --- a/noncore/net/mail/mailistviewitem.h +++ b/noncore/net/mail/mailistviewitem.h | |||
@@ -18,2 +18,3 @@ public: | |||
18 | 18 | ||
19 | virtual QString key(int col,bool) const; | ||
19 | protected: | 20 | protected: |
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 6252fc2..c115b32 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -105,3 +105,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
105 | mailView->setAllColumnsShowFocus(true); | 105 | mailView->setAllColumnsShowFocus(true); |
106 | mailView->setSorting(-1); | 106 | mailView->setShowSortIndicator(true); |
107 | mailView->setSorting(4,false); | ||
107 | 108 | ||
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index ce694d5..d5f9b7f 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -291,3 +291,3 @@ void ViewMail::setMail(const RecMailP&mail ) | |||
291 | m_mail[1] = mail->getSubject(); | 291 | m_mail[1] = mail->getSubject(); |
292 | m_mail[3] = mail->getDate(); | 292 | m_mail[3] = mail->getStringDate(); |
293 | m_mail[4] = mail->Msgid(); | 293 | m_mail[4] = mail->Msgid(); |