-rw-r--r-- | kmicromail/accountitem.cpp | 7 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/abstractmail.cpp | 1 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.cpp | 35 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.h | 2 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 17 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mailtypes.cpp | 14 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/mailtypes.h | 4 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 5 |
8 files changed, 60 insertions, 25 deletions
diff --git a/kmicromail/accountitem.cpp b/kmicromail/accountitem.cpp index 7795055..49d86fc 100644 --- a/kmicromail/accountitem.cpp +++ b/kmicromail/accountitem.cpp | |||
@@ -302,7 +302,7 @@ QPopupMenu * NNTPviewItem::getContextMenu() | |||
302 | { | 302 | { |
303 | m->insertItem(QObject::tr("Disconnect",contextName),0); | 303 | m->insertItem(QObject::tr("Disconnect",contextName),0); |
304 | m->insertItem(QObject::tr("Set offline",contextName),1); | 304 | m->insertItem(QObject::tr("Set offline",contextName),1); |
305 | m->insertItem(QObject::tr("(Un-)Subscribe groups",contextName),2); | 305 | //m->insertItem(QObject::tr("(Un-)Subscribe groups",contextName),2); |
306 | } | 306 | } |
307 | else | 307 | else |
308 | { | 308 | { |
@@ -759,9 +759,8 @@ void IMAPfolderItem::contextMenuSelected(int id) | |||
759 | break; | 759 | break; |
760 | case GET_NEW_MAILS: // daunlood | 760 | case GET_NEW_MAILS: // daunlood |
761 | { | 761 | { |
762 | AccountView*bl = accountView(); | 762 | if (!view) return; |
763 | if (!bl) return; | 763 | view->downloadMailsInbox(getFolder(),imap->getWrapper()); |
764 | bl->downloadMailsInbox(getFolder(),imap->getWrapper()); | ||
765 | } | 764 | } |
766 | break; | 765 | break; |
767 | default: | 766 | default: |
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp index 8f67566..88545f8 100644 --- a/kmicromail/libmailwrapper/abstractmail.cpp +++ b/kmicromail/libmailwrapper/abstractmail.cpp | |||
@@ -204,6 +204,7 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe | |||
204 | ++jjj; | 204 | ++jjj; |
205 | } | 205 | } |
206 | if ( !found ) { | 206 | if ( !found ) { |
207 | //qDebug("AAAdate *%s* ", r->isodate.latin1() ); | ||
207 | n.append( r ); | 208 | n.append( r ); |
208 | } | 209 | } |
209 | ++iii; | 210 | ++iii; |
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index c3a1627..d99c6a3 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp | |||
@@ -27,7 +27,7 @@ Genericwrapper::~Genericwrapper() | |||
27 | } | 27 | } |
28 | cleanMimeCache(); | 28 | cleanMimeCache(); |
29 | } | 29 | } |
30 | QString Genericwrapper::parseDateTime( mailimf_date_time *date ) | 30 | const QDateTime Genericwrapper::parseDateTime( mailimf_date_time *date ) |
31 | { | 31 | { |
32 | static bool init = false ; | 32 | static bool init = false ; |
33 | if ( ! init ) { | 33 | if ( ! init ) { |
@@ -51,15 +51,23 @@ QString Genericwrapper::parseDateTime( mailimf_date_time *date ) | |||
51 | QDate da (date->dt_year,date->dt_month, date->dt_day ); | 51 | QDate da (date->dt_year,date->dt_month, date->dt_day ); |
52 | QTime ti ( date->dt_hour, date->dt_min, date->dt_sec ); | 52 | QTime ti ( date->dt_hour, date->dt_min, date->dt_sec ); |
53 | QDateTime dt ( da ,ti ); | 53 | QDateTime dt ( da ,ti ); |
54 | int addsec = -date->dt_zone*36; | ||
55 | //qDebug("adsec1 %d ",addsec ); | ||
56 | dt = dt.addSecs( addsec ); | ||
54 | int off = KGlobal::locale()->localTimeOffset( dt ); | 57 | int off = KGlobal::locale()->localTimeOffset( dt ); |
55 | //dt = dt.addSecs( off*60 ); | 58 | //qDebug("adsec2 %d ",off*60 ); |
59 | |||
60 | dt = dt.addSecs( off*60 ); | ||
61 | return dt; | ||
62 | #if 0 | ||
56 | QString ret; | 63 | QString ret; |
57 | if ( da == QDate::currentDate () ) | 64 | if ( dt.date() == QDate::currentDate () ) |
58 | ret = KGlobal::locale()->formatTime( ti,true); | 65 | ret = KGlobal::locale()->formatTime( dt.time(),true); |
59 | 66 | ||
60 | else { | 67 | else { |
61 | ret = KGlobal::locale()->formatDateTime( dt,true,true); | 68 | ret = KGlobal::locale()->formatDateTime( dt,true,true); |
62 | } | 69 | } |
70 | #endif | ||
63 | #if 0 | 71 | #if 0 |
64 | if ( off < 0 ) | 72 | if ( off < 0 ) |
65 | ret += " -"; | 73 | ret += " -"; |
@@ -79,7 +87,7 @@ QString Genericwrapper::parseDateTime( mailimf_date_time *date ) | |||
79 | 87 | ||
80 | return QString( tmp ); | 88 | return QString( tmp ); |
81 | #endif | 89 | #endif |
82 | return ret; | 90 | //return ret; |
83 | } | 91 | } |
84 | 92 | ||
85 | void Genericwrapper::fillSingleBody(RecPartP&target,mailmessage*,mailmime*mime) | 93 | void Genericwrapper::fillSingleBody(RecPartP&target,mailmessage*,mailmime*mime) |
@@ -495,11 +503,18 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > & | |||
495 | if (single_fields.fld_bcc) | 503 | if (single_fields.fld_bcc) |
496 | mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) ); | 504 | mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) ); |
497 | if (single_fields.fld_orig_date) { | 505 | if (single_fields.fld_orig_date) { |
498 | mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) ); | 506 | QDateTime dt = Genericwrapper::parseDateTime( single_fields.fld_orig_date->dt_date_time ); |
499 | char tmp[23]; | 507 | QString ret; |
500 | struct mailimf_date_time* date = single_fields.fld_orig_date->dt_date_time; | 508 | if ( dt.date() == QDate::currentDate () ) |
501 | snprintf( tmp, 23, "%04i-%02i-%02i %02i:%02i:%02i %05i", | 509 | ret = KGlobal::locale()->formatTime( dt.time(),true); |
502 | date->dt_year,date->dt_month, date->dt_day, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); | 510 | else { |
511 | ret = KGlobal::locale()->formatDateTime( dt,true,true); | ||
512 | } | ||
513 | mail->setDate( ret ); | ||
514 | char tmp[20]; | ||
515 | snprintf( tmp, 20, "%04i-%02i-%02i %02i:%02i:%02i", | ||
516 | dt.date().year(),dt.date().month(), dt.date().day(), dt.time().hour(), dt.time().minute(), dt.time().second() ); | ||
517 | //qDebug(" iso %s ", tmp); | ||
503 | mail->setIsoDate( QString( tmp ) ); | 518 | mail->setIsoDate( QString( tmp ) ); |
504 | } | 519 | } |
505 | // crashes when accessing pop3 account? | 520 | // crashes when accessing pop3 account? |
diff --git a/kmicromail/libmailwrapper/genericwrapper.h b/kmicromail/libmailwrapper/genericwrapper.h index 244212f..c35a6da 100644 --- a/kmicromail/libmailwrapper/genericwrapper.h +++ b/kmicromail/libmailwrapper/genericwrapper.h | |||
@@ -42,7 +42,7 @@ public: | |||
42 | virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&){return 1;} | 42 | virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&){return 1;} |
43 | virtual void logout(){}; | 43 | virtual void logout(){}; |
44 | virtual void storeMessage(const char*msg,size_t length, const QString&folder){}; | 44 | virtual void storeMessage(const char*msg,size_t length, const QString&folder){}; |
45 | static QString parseDateTime( mailimf_date_time *date ); | 45 | static const QDateTime parseDateTime( mailimf_date_time *date ); |
46 | 46 | ||
47 | protected: | 47 | protected: |
48 | RecBodyP parseMail( mailmessage * msg ); | 48 | RecBodyP parseMail( mailmessage * msg ); |
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 | |||
@@ -8,6 +8,7 @@ | |||
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 | ||
12 | using namespace Opie::Core; | 13 | using namespace Opie::Core; |
13 | int IMAPwrapper::mMax = 0; | 14 | int IMAPwrapper::mMax = 0; |
@@ -465,10 +466,18 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | |||
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); |
diff --git a/kmicromail/libmailwrapper/mailtypes.cpp b/kmicromail/libmailwrapper/mailtypes.cpp index 1a4ffd1..af3b9d0 100644 --- a/kmicromail/libmailwrapper/mailtypes.cpp +++ b/kmicromail/libmailwrapper/mailtypes.cpp | |||
@@ -36,14 +36,20 @@ bool RecMail::isEqual( RecMail* r1 ) | |||
36 | // qDebug("date *%s* *%s* ", isodate.latin1(), r1->isodate.latin1()); | 36 | // qDebug("date *%s* *%s* ", isodate.latin1(), r1->isodate.latin1()); |
37 | return false; | 37 | return false; |
38 | } | 38 | } |
39 | if ( !stringCompareRec( from, r1->from ) ) { | 39 | if ( !stringCompareRec( subject.left(40), r1->subject.left(40) ) ) { |
40 | //qDebug("from *%s* *%s* ", from.latin1(), r1->from.latin1()); | 40 | //qDebug("sub *%s* *%s*", subject.latin1(), r1->subject.latin1()); |
41 | return false; | 41 | return false; |
42 | } | 42 | } |
43 | if ( !stringCompareRec( subject, r1->subject ) ) { | 43 | |
44 | //qDebug("sub "); | 44 | //qDebug("date *%s* *%s* ", isodate.latin1(), r1->isodate.latin1()); |
45 | if ( !stringCompareRec( from.left(40), r1->from.left(40)) ) { | ||
46 | if ( r1->from.find ( from ) < 0 ) { | ||
47 | if ( !stringCompareRec( from.simplifyWhiteSpace ().left(40), r1->from.simplifyWhiteSpace ().left(40)) ) { | ||
48 | //qDebug("from *%s* *%s* ", from.left(40).latin1(), r1->from.left(20).latin1()); | ||
45 | return false; | 49 | return false; |
46 | } | 50 | } |
51 | } | ||
52 | } | ||
47 | 53 | ||
48 | return true; | 54 | return true; |
49 | } | 55 | } |
diff --git a/kmicromail/libmailwrapper/mailtypes.h b/kmicromail/libmailwrapper/mailtypes.h index 020278d..c1c1a74 100644 --- a/kmicromail/libmailwrapper/mailtypes.h +++ b/kmicromail/libmailwrapper/mailtypes.h | |||
@@ -73,9 +73,11 @@ public: | |||
73 | 73 | ||
74 | void setWrapper(AbstractMail*wrapper); | 74 | void setWrapper(AbstractMail*wrapper); |
75 | AbstractMail* Wrapper(); | 75 | AbstractMail* Wrapper(); |
76 | // public for debugging | ||
77 | QString subject,date,isodate,from,mbox,msg_id,replyto; | ||
76 | 78 | ||
77 | protected: | 79 | protected: |
78 | QString subject,date,isodate,from,mbox,msg_id,replyto; | 80 | //QString subject,date,isodate,from,mbox,msg_id,replyto; |
79 | unsigned int msg_number,msg_size; | 81 | unsigned int msg_number,msg_size; |
80 | QBitArray msg_flags; | 82 | QBitArray msg_flags; |
81 | QStringList to,cc,bcc,in_reply_to,references; | 83 | QStringList to,cc,bcc,in_reply_to,references; |
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 7ccfb65..3cbac8e 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -321,7 +321,10 @@ void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | |||
321 | { | 321 | { |
322 | if (mailtype==MAILLIB::A_NNTP) { | 322 | if (mailtype==MAILLIB::A_NNTP) { |
323 | m->insertItem(tr("Read this posting"),this,SLOT(displayMail())); | 323 | m->insertItem(tr("Read this posting"),this,SLOT(displayMail())); |
324 | // m->insertItem(tr("Copy this posting"),this,SLOT(slotMoveCopyMail())); | 324 | m->insertItem(tr("Copy this posting"),this,SLOT(slotMoveCopyMail())); |
325 | m->insertSeparator(); | ||
326 | m->insertItem(tr("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); | ||
327 | m->insertItem(tr("Clear selection"),this,SLOT(clearSelection())); | ||
325 | } else { | 328 | } else { |
326 | if (folderView->currentisDraft()) { | 329 | if (folderView->currentisDraft()) { |
327 | m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail())); | 330 | m->insertItem(tr("Edit this mail"),this,SLOT(reEditMail())); |