summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp10
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp5
-rw-r--r--noncore/net/mail/libmailwrapper/mailstatics.cpp25
-rw-r--r--noncore/net/mail/libmailwrapper/mailstatics.h4
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.cpp28
-rw-r--r--noncore/net/mail/libmailwrapper/mailtypes.h11
-rw-r--r--noncore/net/mail/mailistviewitem.cpp20
-rw-r--r--noncore/net/mail/mailistviewitem.h1
-rw-r--r--noncore/net/mail/mainwindow.cpp17
-rw-r--r--noncore/net/mail/viewmail.cpp6
10 files changed, 81 insertions, 46 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> > &
{
- int r;
+ int r,toffset;
mailmessage_list * env_list = 0;
@@ -439,5 +439,6 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &
mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) );
- if (single_fields.fld_orig_date)
- mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) );
- // crashes when accessing pop3 account?
+ if (single_fields.fld_orig_date) {
+ QDateTime d = parseDateTime( single_fields.fld_orig_date->dt_date_time,toffset);
+ mail->setDate( d,toffset );
+ }
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> > &
}
-
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)
mailimap_flag_fetch*cflag;
- int size;
+ int size,toffset;
QBitArray mFlags(7);
@@ -426,3 +426,4 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
mailimap_envelope * head = item->att_data.att_static->att_data.att_env;
- m->setDate(parseDateTime(head->env_date));
+ QDateTime d = parseDateTime(head->env_date,toffset);
+ m->setDate(d,toffset);
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 @@
#include <libetpan/libetpan.h>
-#include <qpe/timestring.h>
+//#include <qpe/timestring.h>
-QString MailStatics::parseDateTime(const mailimf_date_time *date )
+QDateTime MailStatics::parseDateTime(const mailimf_date_time *date,int&offset )
{
- if (!date) return "";
+ offset = 0;
+ if (!date) {
+ return QDateTime();
+ }
QDateTime da(QDate(date->dt_year,date->dt_month,date->dt_day),QTime(date->dt_hour,date->dt_min,date->dt_sec));
- QString timestring = TimeString::numberDateString(QDate(date->dt_year,date->dt_month,date->dt_day))+" ";
- timestring+=TimeString::timeString(QTime(date->dt_hour,date->dt_min,date->dt_sec))+" ";
- timestring.sprintf(timestring+" %+05i",date->dt_zone);
- return timestring;
+ offset = date->dt_zone;
+ return da;
}
-QString MailStatics::parseDateTime(const char*date)
+QDateTime MailStatics::parseDateTime(const char*date,int&offset)
{
- mailimf_date_time * date_time;
- QString d = "";
+ mailimf_date_time * date_time=0;
+ QDateTime d;
size_t cur_tok = 0;
@@ -22,3 +23,3 @@ QString MailStatics::parseDateTime(const char*date)
if (r==MAILIMF_NO_ERROR) {
- d = parseDateTime(date_time);
+ d = parseDateTime(date_time,offset);
}
@@ -28,2 +29,2 @@ QString MailStatics::parseDateTime(const char*date)
return d;
-} \ No newline at end of file
+}
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
protected:
- static QString parseDateTime(const mailimf_date_time * date);
- static QString parseDateTime(const char*date);
+ static QDateTime parseDateTime(const mailimf_date_time * date,int&offset);
+ static QDateTime parseDateTime(const char*date,int&offset);
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 @@
#include <opie2/odebug.h>
+#include <qpe/timestring.h>
@@ -8,3 +9,3 @@ using namespace Opie::Core;
RecMail::RecMail()
- :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7)
+ :Opie::Core::ORefCount(),subject(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7),maildate(),date("")
{
@@ -14,3 +15,3 @@ RecMail::RecMail()
RecMail::RecMail(const RecMail&old)
- :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7)
+ :Opie::Core::ORefCount(),subject(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_flags(7),maildate(),date("")
{
@@ -18,3 +19,3 @@ RecMail::RecMail(const RecMail&old)
copy_old(old);
- odebug << "Copy constructor RecMail" << oendl;
+ odebug << "Copy constructor RecMail" << oendl;
}
@@ -29,2 +30,3 @@ void RecMail::copy_old(const RecMail&old)
subject = old.subject;
+ maildate = old.maildate;
date = old.date;
@@ -55,2 +57,13 @@ void RecMail::init()
+void RecMail::setDate( const QDateTime&a,int offset)
+{
+ QString timestring = TimeString::numberDateString(a.date())+" ";
+ timestring+=TimeString::timeString(a.time());
+ if (offset > 0) {
+ timestring.sprintf(timestring+" %+05i",offset);
+ }
+ date = timestring;
+ maildate = a;
+}
+
void RecMail::setWrapper(AbstractMail*awrapper)
@@ -136,3 +149,3 @@ RecPart::RecPart(const RecPart&old)
m_poslist = old.m_poslist;
- odebug << "RecPart copy constructor" << oendl;
+ odebug << "RecPart copy constructor" << oendl;
}
@@ -260,3 +273,3 @@ RecBody::RecBody(const RecBody&old)
m_description = old.m_description;
- odebug << "Recbody copy constructor" << oendl;
+ odebug << "Recbody copy constructor" << oendl;
}
@@ -325,3 +338,3 @@ encodedString::encodedString(const encodedString&old)
copy_old(old);
- odebug << "encodedeString: copy constructor!" << oendl;
+ odebug << "encodedeString: copy constructor!" << oendl;
}
@@ -332,3 +345,3 @@ encodedString& encodedString::operator=(const encodedString&old)
copy_old(old);
- odebug << "encodedString: assign operator!" << oendl;
+ odebug << "encodedString: assign operator!" << oendl;
return *this;
@@ -398,2 +411 @@ folderStat&folderStat::operator=(const folderStat&old)
}
-
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 @@
#include <qvaluelist.h>
+#include <qdatetime.h>
@@ -40,4 +41,2 @@ public:
void setNumber(unsigned int number){msg_number=number;}
- const QString&getDate()const{ return date; }
- void setDate( const QString&a ) { date = a; }
const QString&getFrom()const{ return from; }
@@ -73,4 +72,8 @@ public:
+ const QDateTime&getDate()const{ return maildate; }
+ const QString&getStringDate()const{return date;}
+ void setDate( const QDateTime&a,int offset=0 );
+
protected:
- QString subject,date,from,mbox,msg_id,replyto;
+ QString subject,from,mbox,msg_id,replyto;
unsigned int msg_number,msg_size;
@@ -81,2 +84,4 @@ protected:
void copy_old(const RecMail&old);
+ QDateTime maildate;
+ QString date;
};
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 @@
#include <qpe/resource.h>
+#include <qpe/timestring.h>
@@ -15,3 +16,3 @@ void MailListViewItem::showEntry()
} else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) {
- /* I think it looks nicer if there are not such a log of icons but only on mails
+ /* I think it looks nicer if there are not such a lot of icons but only on mails
replied or new - Alwin*/
@@ -50,3 +51,2 @@ void MailListViewItem::showEntry()
}
-
setText(1,mail_data->getSubject());
@@ -54,3 +54,17 @@ void MailListViewItem::showEntry()
setText(3,fsize);
- setText(4,mail_data->getDate());
+ setText(4,mail_data->getStringDate());
+}
+
+QString MailListViewItem::key(int col,bool) const
+{
+ QString temp;
+ if (col == 4) {
+ temp.sprintf( "%08d",QDateTime().secsTo(mail_data->getDate()));
+ return temp;
+ }
+ if (col == 3) {
+ temp.sprintf( "%020d",mail_data->Msgsize());
+ return temp;
+ }
+ return text(col);
}
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:
+ virtual QString key(int col,bool) const;
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 )
mailView->setAllColumnsShowFocus(true);
- mailView->setSorting(-1);
+ mailView->setShowSortIndicator(true);
+ mailView->setSorting(4,false);
@@ -145,3 +146,3 @@ void MainWindow::appMessage(const QCString &, const QByteArray &)
{
- odebug << "appMessage not reached" << oendl;
+ odebug << "appMessage not reached" << oendl;
}
@@ -179,3 +180,3 @@ void MainWindow::slotShowFolders( bool )
{
- odebug << "slotShowFolders not reached" << oendl;
+ odebug << "slotShowFolders not reached" << oendl;
}
@@ -184,3 +185,3 @@ void MainWindow::refreshMailView(const QValueList<RecMailP>&)
{
- odebug << "refreshMailView not reached" << oendl;
+ odebug << "refreshMailView not reached" << oendl;
}
@@ -189,3 +190,3 @@ void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int )
{
- odebug << "mailLeftClicked not reached" << oendl;
+ odebug << "mailLeftClicked not reached" << oendl;
}
@@ -194,3 +195,3 @@ void MainWindow::displayMail()
{
- odebug << "displayMail not reached" << oendl;
+ odebug << "displayMail not reached" << oendl;
}
@@ -199,3 +200,3 @@ void MainWindow::slotDeleteMail()
{
- odebug << "deleteMail not reached" << oendl;
+ odebug << "deleteMail not reached" << oendl;
}
@@ -204,3 +205,3 @@ void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int )
{
- odebug << "mailHold not reached" << oendl;
+ odebug << "mailHold not reached" << oendl;
}
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
@@ -146,3 +146,3 @@ void ViewMail::setBody(const RecBodyP&body )
{
- odebug << it.key() << oendl;
+ odebug << it.key() << oendl;
if (it.key().lower()=="name")
@@ -249,3 +249,3 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
- case 2:
+ case 2:
{
@@ -291,3 +291,3 @@ void ViewMail::setMail(const RecMailP&mail )
m_mail[1] = mail->getSubject();
- m_mail[3] = mail->getDate();
+ m_mail[3] = mail->getStringDate();
m_mail[4] = mail->Msgid();