author | alwin <alwin> | 2004-10-25 22:33:48 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-10-25 22:33:48 (UTC) |
commit | d29de6d360b0570c12778beea9f654a8fcdbe3c7 (patch) (side-by-side diff) | |
tree | ae0b3505b57e0fd47f353faf287408c354d3e6c6 | |
parent | ef34b8716b06f2225d7cf76e22a7a72cf5b689df (diff) | |
download | opie-d29de6d360b0570c12778beea9f654a8fcdbe3c7.zip opie-d29de6d360b0570c12778beea9f654a8fcdbe3c7.tar.gz opie-d29de6d360b0570c12778beea9f654a8fcdbe3c7.tar.bz2 |
moved out pure helper funs
-rw-r--r-- | noncore/net/mail/libmailwrapper/genericwrapper.cpp | 13 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/genericwrapper.h | 5 |
2 files changed, 4 insertions, 14 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,19 +1,19 @@ #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() { @@ -238,25 +238,16 @@ RecBodyP Genericwrapper::parseMail( mailmessage * msg ) 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; diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.h b/noncore/net/mail/libmailwrapper/genericwrapper.h index 8be9212..3336556 100644 --- a/noncore/net/mail/libmailwrapper/genericwrapper.h +++ b/noncore/net/mail/libmailwrapper/genericwrapper.h @@ -1,38 +1,38 @@ #ifndef __GENERIC_WRAPPER_H #define __GENERIC_WRAPPER_H #include "abstractmail.h" +#include "mailstatics.h" #include <qmap.h> #include <qstring.h> #include <libetpan/clist.h> class RecMail; class RecBody; class encodedString; struct mailpop3; struct mailmessage; struct mailmime; struct mailmime_mechanism; struct mailimf_mailbox_list; struct mailimf_mailbox; -struct mailimf_date_time; struct mailimf_group; struct mailimf_address_list; struct mailsession; struct mailstorage; struct mailfolder; struct mailimf_in_reply_to; /* this class hold just the funs shared between * mbox and pop3 (later mh, too) mail access. * it is not desigend to make a instance of it! */ -class Genericwrapper : public AbstractMail +class Genericwrapper : public AbstractMail,public MailStatics { Q_OBJECT public: Genericwrapper(); virtual ~Genericwrapper(); virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part); virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part); @@ -43,17 +43,16 @@ public: virtual void storeMessage(const char*msg,size_t length, const QString&folder){}; protected: RecBodyP parseMail( mailmessage * msg ); QString parseMailboxList( mailimf_mailbox_list *list ); QString parseMailbox( mailimf_mailbox *box ); QString parseGroup( mailimf_group *group ); QString parseAddressList( mailimf_address_list *list ); - QString parseDateTime( mailimf_date_time *date ); void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1); static void fillSingleBody(RecPartP&target,mailmessage*message,mailmime*mime); static void fillParameters(RecPartP&target,clist*parameters); static QString getencoding(mailmime_mechanism*aEnc); virtual void parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false); QStringList parseInreplies(mailimf_in_reply_to * in_replies); |