author | zautrix <zautrix> | 2004-09-16 23:05:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-16 23:05:56 (UTC) |
commit | af411746b1480e7b331ea7d163f39d2507cf7264 (patch) (side-by-side diff) | |
tree | bc839893f0bd002a34368987bdda3e71aad630c4 /kmicromail/libmailwrapper/imapwrapper.cpp | |
parent | b44edfb21be0eee91c4f47401e3fe6ff37e4c16c (diff) | |
download | kdepimpi-af411746b1480e7b331ea7d163f39d2507cf7264.zip kdepimpi-af411746b1480e7b331ea7d163f39d2507cf7264.tar.gz kdepimpi-af411746b1480e7b331ea7d163f39d2507cf7264.tar.bz2 |
Fixed timezone problems in ompi
Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index d79df4f..b0dd1b8 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp @@ -3,16 +3,17 @@ #include <libetpan/libetpan.h> #include <qpe/global.h> #include <qapplication.h> #include "imapwrapper.h" #include "mailtypes.h" #include "logindialog.h" #include <qprogressbar.h> #include "genericwrapper.h" +#include <kglobal.h> using namespace Opie::Core; int IMAPwrapper::mMax = 0; int IMAPwrapper::mCurrent = 0; IMAPwrapper::IMAPwrapper( IMAPaccount *a ) : AbstractMail() { @@ -460,20 +461,28 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) if ( head->env_date != NULL ) { m->setDate(head->env_date); struct mailimf_date_time result; struct mailimf_date_time* date = &result; struct mailimf_date_time **re = &date; size_t length = m->getDate().length(); size_t index = 0; if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) { - m->setDate( Genericwrapper::parseDateTime( date ) ); - char tmp[23]; - snprintf( tmp, 23, "%04i-%02i-%02i %02i:%02i:%02i %05i", - date->dt_year,date->dt_month, date->dt_day, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); + QDateTime dt = Genericwrapper::parseDateTime( date ); + QString ret; + if ( dt.date() == QDate::currentDate () ) + ret = KGlobal::locale()->formatTime( dt.time(),true); + else { + ret = KGlobal::locale()->formatDateTime( dt,true,true); + } + m->setDate( ret ); + char tmp[20]; + snprintf( tmp, 20, "%04i-%02i-%02i %02i:%02i:%02i", + dt.date().year(),dt.date().month(), dt.date().day(), dt.time().hour(), dt.time().minute(), dt.time().second() ); + //qDebug("%d iso %s %s ", date->dt_zone, tmp, head->env_date); m->setIsoDate( QString( tmp ) ); } else { m->setIsoDate(head->env_date); } } if ( head->env_subject != NULL ) m->setSubject(convert_String((const char*)head->env_subject)); //m->setSubject(head->env_subject); |