summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/imapwrapper.cpp
Unidiff
Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp17
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 @@
3#include <libetpan/libetpan.h> 3#include <libetpan/libetpan.h>
4#include <qpe/global.h> 4#include <qpe/global.h>
5#include <qapplication.h> 5#include <qapplication.h>
6#include "imapwrapper.h" 6#include "imapwrapper.h"
7#include "mailtypes.h" 7#include "mailtypes.h"
8#include "logindialog.h" 8#include "logindialog.h"
9#include <qprogressbar.h> 9#include <qprogressbar.h>
10#include "genericwrapper.h" 10#include "genericwrapper.h"
11#include <kglobal.h>
11 12
12using namespace Opie::Core; 13using namespace Opie::Core;
13int IMAPwrapper::mMax = 0; 14int IMAPwrapper::mMax = 0;
14int IMAPwrapper::mCurrent = 0; 15int IMAPwrapper::mCurrent = 0;
15 16
16IMAPwrapper::IMAPwrapper( IMAPaccount *a ) 17IMAPwrapper::IMAPwrapper( IMAPaccount *a )
17 : AbstractMail() 18 : AbstractMail()
18{ 19{
@@ -460,20 +461,28 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
460 if ( head->env_date != NULL ) { 461 if ( head->env_date != NULL ) {
461 m->setDate(head->env_date); 462 m->setDate(head->env_date);
462 struct mailimf_date_time result; 463 struct mailimf_date_time result;
463 struct mailimf_date_time* date = &result; 464 struct mailimf_date_time* date = &result;
464 struct mailimf_date_time **re = &date; 465 struct mailimf_date_time **re = &date;
465 size_t length = m->getDate().length(); 466 size_t length = m->getDate().length();
466 size_t index = 0; 467 size_t index = 0;
467 if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) { 468 if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) {
468 m->setDate( Genericwrapper::parseDateTime( date ) ); 469 QDateTime dt = Genericwrapper::parseDateTime( date );
469 char tmp[23]; 470 QString ret;
470 snprintf( tmp, 23, "%04i-%02i-%02i %02i:%02i:%02i %05i", 471 if ( dt.date() == QDate::currentDate () )
471 date->dt_year,date->dt_month, date->dt_day, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); 472 ret = KGlobal::locale()->formatTime( dt.time(),true);
473 else {
474 ret = KGlobal::locale()->formatDateTime( dt,true,true);
475 }
476 m->setDate( ret );
477 char tmp[20];
478 snprintf( tmp, 20, "%04i-%02i-%02i %02i:%02i:%02i",
479 dt.date().year(),dt.date().month(), dt.date().day(), dt.time().hour(), dt.time().minute(), dt.time().second() );
480 //qDebug("%d iso %s %s ", date->dt_zone, tmp, head->env_date);
472 m->setIsoDate( QString( tmp ) ); 481 m->setIsoDate( QString( tmp ) );
473 } else { 482 } else {
474 m->setIsoDate(head->env_date); 483 m->setIsoDate(head->env_date);
475 } 484 }
476 } 485 }
477 if ( head->env_subject != NULL ) 486 if ( head->env_subject != NULL )
478 m->setSubject(convert_String((const char*)head->env_subject)); 487 m->setSubject(convert_String((const char*)head->env_subject));
479 //m->setSubject(head->env_subject); 488 //m->setSubject(head->env_subject);