summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/genericwrapper.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/genericwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
index 5ec9415..703235d 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
@@ -1,35 +1,35 @@
#include "genericwrapper.h"
#include <libetpan/libetpan.h>
#include "mailtypes.h"
+#include "mailstatics.h"
#include <opie2/odebug.h>
-#include <qpe/timestring.h>
#include <qdatetime.h>
using namespace Opie::Core;
Genericwrapper::Genericwrapper()
- : AbstractMail()
+ : AbstractMail(),MailStatics()
{
bodyCache.clear();
m_storage = 0;
m_folder = 0;
}
Genericwrapper::~Genericwrapper()
{
if (m_folder) {
mailfolder_free(m_folder);
}
if (m_storage) {
mailstorage_free(m_storage);
}
cleanMimeCache();
}
void Genericwrapper::fillSingleBody(RecPartP&target,mailmessage*,mailmime*mime)
{
if (!mime) {
return;
}
mailmime_field*field = 0;
mailmime_single_fields fields;
@@ -222,57 +222,48 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m
target->addPart(part);
}
if (mime->mm_data.mm_message.mm_msg_mime != NULL) {
traverseBody(target,message,mime->mm_data.mm_message.mm_msg_mime,countlist,current_rec+1);
}
}
break;
}
}
RecBodyP Genericwrapper::parseMail( mailmessage * msg )
{
int err = MAILIMF_NO_ERROR;
mailmime_single_fields fields;
/* is bound to msg and will be freed there */
mailmime * mime=0;
RecBodyP body = new RecBody();
memset(&fields, 0, sizeof(struct mailmime_single_fields));
err = mailmessage_get_bodystructure(msg,&mime);
QValueList<int>recList;
traverseBody(body,msg,mime,recList);
return body;
}
-QString Genericwrapper::parseDateTime( mailimf_date_time *date )
-{
- 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;
-}
-
QString Genericwrapper::parseAddressList( mailimf_address_list *list )
{
QString result( "" );
bool first = true;
if (list == 0) return result;
for ( clistiter *current = clist_begin( list->ad_list ); current != NULL; current = current->next ) {
mailimf_address *addr = (mailimf_address *) current->data;
if ( !first ) {
result.append( "," );
} else {
first = false;
}
switch ( addr->ad_type ) {
case MAILIMF_ADDRESS_MAILBOX:
result.append( parseMailbox( addr->ad_data.ad_mailbox ) );
break;
case MAILIMF_ADDRESS_GROUP:
result.append( parseGroup( addr->ad_data.ad_group ) );
break;
default:
odebug << "Generic: unkown mailimf address type" << oendl;