-rw-r--r-- | kmicromail/libmailwrapper/abstractmail.cpp | 11 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.cpp | 16 |
2 files changed, 16 insertions, 11 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp index 374d606..44878e0 100644 --- a/kmicromail/libmailwrapper/abstractmail.cpp +++ b/kmicromail/libmailwrapper/abstractmail.cpp @@ -141,103 +141,98 @@ QString AbstractMail::draftFolder() /* temporary - will be removed when implemented in all classes */ void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &) { } void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) { //qDebug("AbstractMail::deleteMailList:: Please reimplement! "); // this is currently re-implemented in pop3wrapper and imapwrapper int iii = 0; int count = target.count(); QWidget wid; wid.show(); while (iii < count ) { Global::statusMessage(tr("Delete message %1 of %2").arg(iii).arg(count)); wid.raise(); qApp->processEvents(); RecMailP mail = (*target.at( iii )); deleteMail(mail); ++iii; } } void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targetMail ) { - qDebug("AbstractMail::downloadNewMails %s ", fromFolder->getName().latin1()); + //qDebug("AbstractMail::downloadNewMails %s ", fromFolder->getName().latin1()); // get local folder Account * acc = getAccount(); if ( !acc ) return; QString lfName = acc->getLocalFolder(); if ( lfName.isEmpty() ) lfName = acc->getAccountName(); // create local folder if ( !targetMail->createMbox(lfName)) { QMessageBox::critical(0,tr("Error creating new Folder"), tr("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); return; } QValueList<RecMailP> t; listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); if ( t.count() == 0 ) { Global::statusMessage(tr("There are no new messages")); return; } QValueList<RecMailP> e; targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); - qDebug("target has mails %d ", e.count()); + //qDebug("target has mails %d ", e.count()); QValueList<RecMailP> n; int iii = 0; int count = t.count(); while (iii < count ) { RecMailP r = (*t.at( iii )); bool found = false; int jjj = 0; int countE = e.count(); while (jjj < countE ) { RecMailP re = (*e.at( jjj )); if ( re->isEqual(r) ) { found = true; break; } ++jjj; } - if ( found ) - qDebug("found "); - else - qDebug("NOT found "); - if ( !found ) { n.append( r ); } ++iii; } if ( n.count() == 0 ) { Global::statusMessage(tr("There are no new messages")); return; } mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer()); - + Global::statusMessage(tr("Downloaded %1 messages").arg(n.count())); #if 0 QValueList<RecMailP> t; listMessages(fromFolder->getName(),t, maxSizeInKb); mvcpMailList( t,targetFolder,targetWrapper,moveit); #endif } void AbstractMail::mvcpAllMails(const FolderP&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) { QValueList<RecMailP> t; listMessages(fromFolder->getName(),t, maxSizeInKb); mvcpMailList( t,targetFolder,targetWrapper,moveit); } void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) { encodedString*st = 0; int iii = 0; int count = t.count(); if ( count == 0 ) return; diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index 2b04847..ed591fc 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp @@ -25,58 +25,68 @@ Genericwrapper::~Genericwrapper() if (m_storage) { mailstorage_free(m_storage); } cleanMimeCache(); } QString Genericwrapper::parseDateTime( mailimf_date_time *date ) { static bool init = false ; if ( ! init ) { KConfig kon ( locateLocal( "config", "korganizerrc" ) ); kon.setGroup("Locale"); KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) ); QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( ""); KGlobal::locale()->setHore24Format( !kon.readBoolEntry( "PreferredTime",0 ) ); KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); kon.setGroup("Time & Date"); KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ), kon.readNumEntry( "DaylightsavingStart", 90), kon.readNumEntry( "DaylightsavingEnd",304) ); KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") ); init = true; } - QDateTime dt (QDate(date->dt_year,date->dt_month, date->dt_day ),QTime(date->dt_hour, date->dt_min, date->dt_sec ) ); + QDate da (date->dt_year,date->dt_month, date->dt_day ); + QTime ti ( date->dt_hour, date->dt_min, date->dt_sec ); + QDateTime dt ( da ,ti ); int off = KGlobal::locale()->localTimeOffset( dt ); - dt = dt.addSecs( off*60 ); - QString ret = KGlobal::locale()->formatDateTime( dt,true,true); + //dt = dt.addSecs( off*60 ); + QString ret; + if ( da == QDate::currentDate () ) + ret = KGlobal::locale()->formatTime( ti,true); + + else { + ret = KGlobal::locale()->formatDateTime( dt,true,true); + } +#if 0 if ( off < 0 ) ret += " -"; else ret += " +"; ret += QString::number( off / 60 ); ret += "h"; +#endif #if 0 char tmp[23]; // snprintf( tmp, 23, "%02i.%02i.%04i %02i:%02i:%02i %+05i", // date->dt_day, date->dt_month, date->dt_year, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); 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 ); return QString( tmp ); #endif return ret; } void Genericwrapper::fillSingleBody(RecPartP&target,mailmessage*,mailmime*mime) { if (!mime) { return; } mailmime_field*field = 0; mailmime_single_fields fields; memset(&fields, 0, sizeof(struct mailmime_single_fields)); if (mime->mm_mime_fields != NULL) { mailmime_single_fields_init(&fields, mime->mm_mime_fields, |