author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kmicromail/libmailwrapper | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
25 files changed, 159 insertions, 115 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp index 870985e..746d2ae 100644 --- a/kmicromail/libmailwrapper/abstractmail.cpp +++ b/kmicromail/libmailwrapper/abstractmail.cpp @@ -5,19 +5,21 @@ #include "nntpwrapper.h" #include "mhwrapper.h" #include "mailtypes.h" #include <qpe/global.h> -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qapplication.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <klocale.h> #include <kdecore/kstandarddirs.h> #include <qfile.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <stdlib.h> #include <libetpan/mailmime_content.h> #include <libetpan/mailmime.h> using namespace Opie::Core; AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) @@ -108,16 +110,16 @@ QString AbstractMail::convert_String(const char*text) } /* cp & paste from launcher */ QString AbstractMail::gen_attachment_id() { QFile file( "/proc/sys/kernel/random/uuid" ); - if (!file.open(IO_ReadOnly ) ) + if (!file.open(QIODevice::ReadOnly ) ) return QString::null; - QTextStream stream(&file); + Q3TextStream stream(&file); return "{" + stream.read().stripWhiteSpace() + "}"; } int AbstractMail::createMbox(const QString&,const FolderP&,const QString& ,bool) { @@ -135,22 +137,22 @@ QString AbstractMail::defaultLocalfolder() QString AbstractMail::draftFolder() { return QString("Drafts"); } /* temporary - will be removed when implemented in all classes */ -void AbstractMail::deleteMails(const QString &,const QValueList<Opie::Core::OSmartPointer<RecMail> > &) +void AbstractMail::deleteMails(const QString &,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &) { } -void AbstractMail::deleteMailList(const QValueList<RecMailP>&target) +void AbstractMail::deleteMailList(const Q3ValueList<RecMailP>&target) { //qDebug("AbstractMail::deleteMailList:: Please reimplement! "); // this is currently re-implemented in pop3wrapper and imapwrapper int iii = 0; int count = target.count(); - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Deleting ...")); wid.show(); while (iii < count ) { Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); wid.setProgress( iii ); wid.raise(); @@ -174,26 +176,26 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe if ( !targetMail->createMbox(lfName)) { QMessageBox::critical(0,i18n("Error creating new Folder"), i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); return; } - QValueList<RecMailP> t; + Q3ValueList<RecMailP> t; listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); if ( t.count() == 0 ) { qDebug("There are no new messages %s", fromFolder->getName().latin1()); Global::statusMessage(i18n("There are no new messages")); return; } Global::statusMessage(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); qDebug(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); qApp->processEvents(); - QValueList<RecMailP> e; + Q3ValueList<RecMailP> e; targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); //qDebug("target has mails %d ", e.count()); - QValueList<RecMailP> n; + Q3ValueList<RecMailP> n; int iii = 0; int count = t.count(); while (iii < count ) { RecMailP r = (*t.at( iii )); bool found = false; int jjj = 0; @@ -218,38 +220,38 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe return; } mvcpMailList( n,lfName,targetMail,!acc->getLeaveOnServer()); Global::statusMessage(i18n("Downloaded %1 messages").arg(n.count())); #if 0 - QValueList<RecMailP> t; + Q3ValueList<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; + Q3ValueList<RecMailP> t; listMessages(fromFolder->getName(),t, maxSizeInKb); mvcpMailList( t,targetFolder,targetWrapper,moveit); } -void AbstractMail::mvcpMailList(const QValueList<RecMailP>& t, +void AbstractMail::mvcpMailList(const Q3ValueList<RecMailP>& t, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) { encodedString*st = 0; int iii = 0; int count = t.count(); if ( count == 0 ) return; // wel, processevents is qite strange, we need a widget for getting // Global::statusMessage(i18n("Copy2 message %1").arg(iii)); displaye - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Copying...")); wid.show(); while (iii < count ) { Global::statusMessage(i18n("Copy message %1 of %2").arg(iii).arg(count)); wid.setProgress( iii ); wid.raise(); diff --git a/kmicromail/libmailwrapper/abstractmail.h b/kmicromail/libmailwrapper/abstractmail.h index 2069ca1..f606b1f 100644 --- a/kmicromail/libmailwrapper/abstractmail.h +++ b/kmicromail/libmailwrapper/abstractmail.h @@ -4,12 +4,14 @@ #include "maildefines.h" #include "settings.h" #include <qobject.h> +//Added by qt3to4: +#include <Q3ValueList> #include <opie2/osmartpointer.h> #include "mailtypes.h" #include "mailwrapper.h" @@ -22,32 +24,32 @@ struct folderStat; class AbstractMail:public QObject { Q_OBJECT public: AbstractMail(){}; virtual ~AbstractMail(){} - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0; - virtual void listMessages(const QString & mailbox,QValueList<RecMailP>&target, int sizeInKb = 0 )=0; + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders()=0; + virtual void listMessages(const QString & mailbox,Q3ValueList<RecMailP>&target, int sizeInKb = 0 )=0; virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX")=0; virtual RecBodyP fetchBody(const RecMailP&mail)=0; virtual QString fetchTextPart(const RecMailP&mail,const RecPartP&part)=0; virtual encodedString* fetchDecodedPart(const RecMailP&mail,const RecPartP&part)=0; virtual encodedString* fetchRawPart(const RecMailP&mail,const RecPartP&part)=0; virtual encodedString* fetchRawBody(const RecMailP&mail)=0; virtual void deleteMail(const RecMailP&mail)=0; - virtual void deleteMailList(const QValueList<RecMailP>&target); + virtual void deleteMailList(const Q3ValueList<RecMailP>&target); virtual void answeredMail(const RecMailP&mail)=0; virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&)=0; - virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> >&target); + virtual void deleteMails(const QString & FolderName,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target); virtual int deleteMbox(const Opie::Core::OSmartPointer<Folder>&)=0; virtual void storeMessage(const char*msg,size_t length, const QString&folder)=0; void downloadNewMails(const FolderP&fromFolder,AbstractMail*targetWrapper ); virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int sizeInKb = 0); - virtual void mvcpMailList(const QValueList<RecMailP>& t, + virtual void mvcpMailList(const Q3ValueList<RecMailP>& t, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual void cleanMimeCache(){}; /* mail box methods */ /* parameter is the box to create. diff --git a/kmicromail/libmailwrapper/generatemail.cpp b/kmicromail/libmailwrapper/generatemail.cpp index 2d213fe..ddad21b 100644 --- a/kmicromail/libmailwrapper/generatemail.cpp +++ b/kmicromail/libmailwrapper/generatemail.cpp @@ -4,12 +4,14 @@ #include <libetpan/libetpan.h> //#include <qt.h> #include <stdlib.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <Q3CString> using namespace Opie::Core; const char* Generatemail::USER_AGENT="KOpieMail 33 1/3"; Generatemail::Generatemail() { @@ -225,13 +227,13 @@ void Generatemail::addFileParts( mailmime *message,const QList<Attachment>&files mailmime *Generatemail::buildTxtPart(const QString&str ) { mailmime *txtPart; mailmime_fields *fields; mailmime_content *content; mailmime_parameter *param; int err; - QCString __str; + Q3CString __str; //qDebug(" Generatemail::buildTxtPart %s", str.latin1()); param = mailmime_parameter_new( strdup( "charset" ), strdup( mCharset.latin1() ) ); if ( param == NULL ) goto err_free; @@ -249,13 +251,13 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) { txtPart = mailmime_new_empty( content, fields ); if ( txtPart == NULL ) goto err_free_fields; { //__str = str.utf8(); - __str = QCString (str.latin1()); + __str = Q3CString (str.latin1()); err = mailmime_set_body_text( txtPart, strdup(__str.data()), __str.length() ); } if ( err != MAILIMF_NO_ERROR ) goto err_free_txtPart; return txtPart; // Success :) diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index 0b6adf7..633ab42 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp @@ -3,12 +3,14 @@ #include <libetpan/libetpan.h> #include "mailtypes.h" #include <kconfig.h> #include <kglobal.h> #include <kstandarddirs.h> +//Added by qt3to4: +#include <Q3ValueList> using namespace Opie::Core; Genericwrapper::Genericwrapper() : AbstractMail() { @@ -179,13 +181,13 @@ QString Genericwrapper::getencoding(mailmime_mechanism*aEnc) } break; } return enc; } -void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count) +void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueList<int>recList,unsigned int current_rec,int current_count) { if (current_rec >= 10) { ; // odebug << "too deep recursion!" << oendl; } if (!message || !mime) { return; @@ -197,13 +199,13 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m QString b; RecPartP part = new RecPart(); switch (mime->mm_type) { case MAILMIME_SINGLE: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; countlist.append(current_count); r = mailmessage_fetch_section(message,mime,&data,&len); part->setSize(len); part->setPositionlist(countlist); b = gen_attachment_id(); part->setIdentifier(b); @@ -247,13 +249,13 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m } break; case MAILMIME_MULTIPLE: { unsigned int ccount = 1; mailmime*cbody=0; - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; for (cur = clist_begin(mime->mm_data.mm_multipart.mm_mp_list) ; cur != NULL ; cur = clist_next(cur)) { cbody = (mailmime*)clist_content(cur); if (cbody->mm_type==MAILMIME_MULTIPLE) { RecPartP targetPart = new RecPart(); targetPart->setType("multipart"); countlist.append(current_count); @@ -267,13 +269,13 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m ++ccount; } } break; case MAILMIME_MESSAGE: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; countlist.append(current_count); /* the own header is always at recursion 0 - we don't need that */ if (current_rec > 0) { part->setPositionlist(countlist); r = mailmessage_fetch_section(message,mime,&data,&len); part->setSize(len); @@ -299,13 +301,13 @@ RecBodyP Genericwrapper::parseMail( mailmessage * msg ) //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; + Q3ValueList<int>recList; traverseBody(body,msg,mime,recList); return body; } QString Genericwrapper::parseAddressList( mailimf_address_list *list ) @@ -444,13 +446,13 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) res.append(h); } } return res; } -void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) +void Genericwrapper::parseList(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) { int r; mailmessage_list * env_list = 0; r = mailsession_get_messages_list(session,&env_list); if (r != MAIL_NO_ERROR) { ; // odebug << "Error message list" << oendl; diff --git a/kmicromail/libmailwrapper/genericwrapper.h b/kmicromail/libmailwrapper/genericwrapper.h index c35a6da..a50161d 100644 --- a/kmicromail/libmailwrapper/genericwrapper.h +++ b/kmicromail/libmailwrapper/genericwrapper.h @@ -2,12 +2,14 @@ #ifndef __GENERIC_WRAPPER_H #define __GENERIC_WRAPPER_H #include "abstractmail.h" #include <qmap.h> #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> #include <libetpan/clist.h> class RecMail; class RecBody; class encodedString; struct mailpop3; @@ -48,17 +50,17 @@ 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 ); - void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rek=0,int current_count=1); + void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueList<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, int maxSizeInKb = 0); + virtual void parseList(Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0); QStringList parseInreplies(mailimf_in_reply_to * in_replies); QString msgTempName; unsigned int last_msg_id; QMap<QString,encodedString*> bodyCache; mailstorage * m_storage; diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 4f0c849..f73f4cc 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp @@ -1,15 +1,17 @@ // CHANGED 2004-09-31 Lutz Rogowski #include <stdlib.h> #include <libetpan/libetpan.h> #include <qpe/global.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3ValueList> #include "imapwrapper.h" #include "mailtypes.h" #include "logindialog.h" -#include <qprogressbar.h> +#include <q3progressbar.h> #include "genericwrapper.h" #include <kglobal.h> using namespace Opie::Core; int IMAPwrapper::mMax = 0; int IMAPwrapper::mCurrent = 0; @@ -236,13 +238,13 @@ void IMAPwrapper::logout() err = mailimap_close( m_imap ); mailimap_free( m_imap ); m_imap = 0; m_Lastmbox = ""; } -void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) +void IMAPwrapper::listMessages(const QString&mailbox,Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target , int maxSizeInKb) { int tryAgain = 1; while ( tryAgain >= 0 ) { int err = MAILIMAP_NO_ERROR; clist *result = 0; @@ -317,22 +319,22 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma } if (result) mailimap_fetch_list_free(result); } } -QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() { const char *path, *mask; int err = MAILIMAP_NO_ERROR; clist *result = 0; clistcell *current = 0; clistcell*cur_flag = 0; mailimap_mbx_list_flags*bflags = 0; - QValueList<FolderP>* folders = new QValueList<FolderP>(); + Q3ValueList<FolderP>* folders = new Q3ValueList<FolderP>(); login(); if (!m_imap) { return folders; } /* @@ -610,13 +612,13 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) mailimap_fetch_type_free( fetchType ); if (err == MAILIMAP_NO_ERROR && (current=clist_begin(result)) ) { mailimap_msg_att * msg_att; msg_att = (mailimap_msg_att*)current->data; mailimap_msg_att_item*item = (mailimap_msg_att_item*)msg_att->att_list->first->data; - QValueList<int> path; + Q3ValueList<int> path; body_desc = item->att_data.att_static->att_data.att_body; traverseBody(mail,body_desc,body,0,path); } else { qDebug("error fetching body %d (%d): %s", err, MAILIMAP_NO_ERROR, m_imap->imap_response ); } if (result) mailimap_fetch_list_free(result); @@ -661,13 +663,13 @@ QStringList IMAPwrapper::address_list_to_stringlist(clist*list) break; } } return l; } -encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call) +encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call) { encodedString*res=new encodedString; int err; mailimap_fetch_type *fetchType; mailimap_set *set; clistcell*current,*cur; @@ -735,21 +737,21 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int return res; } /* current_recursion is for recursive calls. current_count means the position inside the internal loop! */ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body, - int current_recursion,QValueList<int>recList,int current_count) + int current_recursion,Q3ValueList<int>recList,int current_count) { if (!body || current_recursion>=10) { return; } switch (body->bd_type) { case MAILIMAP_BODY_1PART: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; countlist.append(current_count); RecPartP currentPart = new RecPart(); mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; QString id(""); currentPart->setPositionlist(countlist); for (unsigned int j = 0; j < countlist.count();++j) { @@ -796,13 +798,13 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t traverseBody(mail,part1->bd_data.bd_type_msg->bd_body,target_body,current_recursion+1,countlist); } } break; case MAILIMAP_BODY_MPART: { - QValueList<int>countlist = recList; + Q3ValueList<int>countlist = recList; clistcell*current=0; mailimap_body*current_body=0; unsigned int ccount = 1; mailimap_body_type_mpart*mailDescription = body->bd_data.bd_body_mpart; for (current=clist_begin(mailDescription->bd_list);current!=0;current=clist_next(current)) { current_body = (mailimap_body*)current->data; @@ -982,13 +984,13 @@ void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which if (which->bd_description) { target_part->setDescription(QString(which->bd_description)); } target_part->setEncoding(encoding); target_part->setSize(which->bd_size); } -void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) +void IMAPwrapper::deleteMailList(const Q3ValueList<RecMailP>&target) { //#if 0 mailimap_flag_list*flist; mailimap_set *set; mailimap_store_att_flags * store_flags; int err; @@ -1002,13 +1004,13 @@ void IMAPwrapper::deleteMailList(const QValueList<RecMailP>&target) // qDebug("imap remove count %d ", count); mMax = count; progress( i18n("Delete")); - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Deleting ...")); wid.show(); while (iii < count ) { Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); wid.setProgress( iii ); wid.raise(); @@ -1111,13 +1113,13 @@ void IMAPwrapper::answeredMail(const RecMailP&mail) if (err != MAILIMAP_NO_ERROR) { // odebug << "error marking mail: " << m_imap->imap_response << "" << oendl; return; } } -QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) +QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call,const QString&enc) { QString body(""); encodedString*res = fetchRawPart(mail,path,internal_call); encodedString*r = decode_String(res,enc); delete res; if (r) { @@ -1296,13 +1298,13 @@ const QString&IMAPwrapper::getName()const return account->getAccountName(); } encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) { // dummy - QValueList<int> path; + Q3ValueList<int> path; return fetchRawPart(mail,path,false); } void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) { diff --git a/kmicromail/libmailwrapper/imapwrapper.h b/kmicromail/libmailwrapper/imapwrapper.h index 31c60a8..d3d3ecd 100644 --- a/kmicromail/libmailwrapper/imapwrapper.h +++ b/kmicromail/libmailwrapper/imapwrapper.h @@ -1,11 +1,13 @@ // CHANGED 2004-09-31 Lutz Rogowski #ifndef __IMAPWRAPPER #define __IMAPWRAPPER #include <qlist.h> +//Added by qt3to4: +#include <Q3ValueList> #include "mailwrapper.h" #include "abstractmail.h" #include <libetpan/clist.h> struct mailimap; struct mailimap_body; @@ -21,18 +23,18 @@ class encodedString; class IMAPwrapper : public AbstractMail { Q_OBJECT public: IMAPwrapper( IMAPaccount *a ); virtual ~IMAPwrapper(); - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); - virtual void listMessages(const QString & mailbox,QValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual void listMessages(const QString & mailbox,Q3ValueList<Opie::Core::OSmartPointer<RecMail> >&target , int sizeInKb = 0); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); - void deleteMailList(const QValueList<RecMailP>&target); + void deleteMailList(const Q3ValueList<RecMailP>&target); virtual void answeredMail(const RecMailP&mail); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&folder); virtual void storeMessage(const char*msg,size_t length, const QString&folder); virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit,int sizeInKb = 0); virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); @@ -56,22 +58,22 @@ public: protected: RecMail*parse_list_result(mailimap_msg_att*); void login(bool tryTLS = true); bool start_tls(bool force=true); - virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc=""); - virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call); + virtual QString fetchTextPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call=false,const QString&enc=""); + virtual encodedString*fetchRawPart(const RecMailP&mail,const Q3ValueList<int>&path,bool internal_call); int selectMbox(const QString&mbox); void fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description); void fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which); void fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which); void fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which); void fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which); - void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,QValueList<int>recList,int current_count=1); + void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,Q3ValueList<int>recList,int current_count=1); /* just helpers */ static void fillBodyFields(RecPartP&target_part,mailimap_body_fields*which); static QStringList address_list_to_stringlist(clist*list); static void progress(QString mess = QString::null); diff --git a/kmicromail/libmailwrapper/libmailwrapper.pro b/kmicromail/libmailwrapper/libmailwrapper.pro index 646630b..6b595ab 100644 --- a/kmicromail/libmailwrapper/libmailwrapper.pro +++ b/kmicromail/libmailwrapper/libmailwrapper.pro @@ -35,13 +35,14 @@ SOURCES = imapwrapper.cpp \ nntpwrapper.cpp \ generatemail.cpp \ storemail.cpp \ ../qpe/qdialog_hacked.cpp \ ../qpe/global.cpp -INTERFACES = logindialogui.ui \ +#The following line was changed from INTERFACES to FORMS3 by qt3to4 +FORMS3 = logindialogui.ui \ sendmailprogressui.ui INCLUDEPATH += ../qpe .. ../../microkde ../../microkde/kdecore ../../libetpan/include LIBS += -lssl -lcrypto #-lqpe -letpan @@ -60,6 +61,11 @@ LIBS += mfc71u.lib QMAKE_LINK += /NODEFAULTLIB:LIBC #QMAKE_LINK += /NODEFAULTLIB:MSVCRT #QMAKE_LINK += /NODEFAULTLIB:uafxcw.lib OBJECTS_DIR = obj/win MOC_DIR = moc/win } +#The following line was inserted by qt3to4 +QT += xml qt3support +#The following line was inserted by qt3to4 +CONFIG += uic3 + diff --git a/kmicromail/libmailwrapper/logindialog.cpp b/kmicromail/libmailwrapper/logindialog.cpp index 31b75d0..d1f4b5d 100644 --- a/kmicromail/libmailwrapper/logindialog.cpp +++ b/kmicromail/libmailwrapper/logindialog.cpp @@ -3,13 +3,13 @@ #include "logindialog.h" //using namespace Opie::Core; -LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, WFlags flags ) +LoginDialog::LoginDialog(const QString&user,const QString&pass, QWidget *parent, const char *name, bool modal, Qt::WFlags flags ) : LoginDialogUI( parent, name, modal, flags ) { userLine->setText( (user.isEmpty()?QString(""):user) ); passLine->setText( (pass.isEmpty()?QString(""):pass) ); _user = user; _pass = pass; diff --git a/kmicromail/libmailwrapper/logindialog.h b/kmicromail/libmailwrapper/logindialog.h index f406f2c..a18daa5 100644 --- a/kmicromail/libmailwrapper/logindialog.h +++ b/kmicromail/libmailwrapper/logindialog.h @@ -5,13 +5,13 @@ class LoginDialog : public LoginDialogUI { Q_OBJECT public: - LoginDialog(const QString&user,const QString&pass, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); + LoginDialog(const QString&user,const QString&pass, QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags flags = 0 ); QString getUser() { return _user; } QString getPassword() { return _pass; } protected slots: void accept(); diff --git a/kmicromail/libmailwrapper/mailtypes.cpp b/kmicromail/libmailwrapper/mailtypes.cpp index 70a0ab5..84ccf9f 100644 --- a/kmicromail/libmailwrapper/mailtypes.cpp +++ b/kmicromail/libmailwrapper/mailtypes.cpp @@ -1,11 +1,13 @@ #include "mailtypes.h" //#include <opie2/odebug.h> #include <stdlib.h> +//Added by qt3to4: +#include <Q3ValueList> using namespace Opie::Core; RecMail::RecMail() :Opie::Core::ORefCount(),subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) { init(); @@ -280,18 +282,18 @@ const QString RecPart::searchParamter(const QString&key)const if (it != m_Parameters.end()) { value = it.data(); } return value; } -void RecPart::setPositionlist(const QValueList<int>&poslist) +void RecPart::setPositionlist(const Q3ValueList<int>&poslist) { m_poslist = poslist; } -const QValueList<int>& RecPart::Positionlist()const +const Q3ValueList<int>& RecPart::Positionlist()const { return m_poslist; } RecBody::RecBody() : Opie::Core::ORefCount(),m_BodyText(),m_description(new RecPart()) @@ -320,19 +322,19 @@ void RecBody::setBodytext(const QString&bodyText) const QString& RecBody::Bodytext()const { return m_BodyText; } -void RecBody::setParts(const QValueList<RecPartP>&parts) +void RecBody::setParts(const Q3ValueList<RecPartP>&parts) { m_PartsList.clear(); m_PartsList = parts; } -const QValueList<RecPartP>& RecBody::Parts()const +const Q3ValueList<RecPartP>& RecBody::Parts()const { return m_PartsList; } void RecBody::addPart(const RecPartP& part) { diff --git a/kmicromail/libmailwrapper/mailtypes.h b/kmicromail/libmailwrapper/mailtypes.h index 97f10d7..ac7f8da 100644 --- a/kmicromail/libmailwrapper/mailtypes.h +++ b/kmicromail/libmailwrapper/mailtypes.h @@ -11,13 +11,13 @@ #include <opie2/osmartpointer.h> #include <qbitarray.h> #include <qstring.h> #include <qstringlist.h> #include <qmap.h> -#include <qvaluelist.h> +#include <q3valuelist.h> class AbstractMail; /* a class to describe mails in a mailbox */ /* Attention! From programmers point of view it would make sense to store the mail body into this class, too. @@ -106,13 +106,13 @@ class RecPart:public Opie::Core::ORefCount { protected: QString m_type,m_subtype,m_identifier,m_encoding,m_description; unsigned int m_lines,m_size; part_plist_t m_Parameters; /* describes the position in the mail */ - QValueList<int> m_poslist; + Q3ValueList<int> m_poslist; public: RecPart(); RecPart(const RecPart&); virtual ~RecPart(); @@ -133,24 +133,24 @@ public: void setParameters(const part_plist_t&list); const part_plist_t&Parameters()const; void addParameter(const QString&key,const QString&value); const QString searchParamter(const QString&key)const; - void setPositionlist(const QValueList<int>&poslist); - const QValueList<int>& Positionlist()const; + void setPositionlist(const Q3ValueList<int>&poslist); + const Q3ValueList<int>& Positionlist()const; }; typedef Opie::Core::OSmartPointer<RecPart> RecPartP; class RecBody:public Opie::Core::ORefCount { protected: QString m_BodyText; QString mCharset; - QValueList<RecPartP> m_PartsList; + Q3ValueList<RecPartP> m_PartsList; RecPartP m_description; public: RecBody(); RecBody(const RecBody&old); virtual ~RecBody(); @@ -159,14 +159,14 @@ public: void setCharset(const QString&); QString getCharset()const; void setDescription(const RecPartP&des); const RecPartP& Description()const; - void setParts(const QValueList<RecPartP>&parts); - const QValueList<RecPartP>& Parts()const; + void setParts(const Q3ValueList<RecPartP>&parts); + const Q3ValueList<RecPartP>& Parts()const; void addPart(const RecPartP&part); }; typedef Opie::Core::OSmartPointer<RecBody> RecBodyP; class encodedString diff --git a/kmicromail/libmailwrapper/mailwrapper.cpp b/kmicromail/libmailwrapper/mailwrapper.cpp index 2ee1ab3..9c299e8 100644 --- a/kmicromail/libmailwrapper/mailwrapper.cpp +++ b/kmicromail/libmailwrapper/mailwrapper.cpp @@ -2,12 +2,14 @@ #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <fcntl.h> #include <string.h> #include <qdir.h> +//Added by qt3to4: +#include <Q3CString> #include "mailwrapper.h" //#include "logindialog.h" //#include "defines.h" #define UNDEFINED 64 @@ -78,37 +80,37 @@ static unsigned char base64chars[] = QString IMAPFolder::decodeFolderName( const QString &name ) { unsigned char c, i, bitcount; unsigned long ucs4, utf16, bitbuf; unsigned char base64[256], utf8[6]; unsigned long srcPtr = 0; - QCString dst = ""; - QCString src = name.ascii(); + Q3CString dst = ""; + Q3CString src = name.ascii(); /* initialize modified base64 decoding table */ memset(base64, UNDEFINED, sizeof(base64)); for (i = 0; i < sizeof(base64chars); ++i) { base64[(int)base64chars[i]] = i; } /* loop until end of string */ while (srcPtr < src.length ()) { - c = src[srcPtr++]; + c = src.at(srcPtr++); /* deal with literal characters and &- */ - if (c != '&' || src[srcPtr] == '-') { + if (c != '&' || src.at(srcPtr) == '-') { /* encode literally */ dst += c; /* skip over the '-' if this is an &- sequence */ if (c == '&') srcPtr++; } else { /* convert modified UTF-7 -> UTF-16 -> UCS-4 -> UTF-8 -> HEX */ bitbuf = 0; bitcount = 0; ucs4 = 0; - while ((c = base64[(unsigned char) src[srcPtr]]) != UNDEFINED) { + while ((c = base64[(unsigned char) src.at(srcPtr)]) != UNDEFINED) { ++srcPtr; bitbuf = (bitbuf << 6) | c; bitcount += 6; /* enough bits for a UTF-16 character? */ if (bitcount >= 16) { bitcount -= 16; @@ -146,13 +148,13 @@ QString IMAPFolder::decodeFolderName( const QString &name ) for (c = 0; c < i; ++c) { dst += utf8[c]; } } } /* skip over trailing '-' in modified UTF-7 encoding */ - if (src[srcPtr] == '-') + if (src.at(srcPtr) == '-') ++srcPtr; } } return QString::fromUtf8( dst.data() ); } diff --git a/kmicromail/libmailwrapper/mailwrapper.h b/kmicromail/libmailwrapper/mailwrapper.h index 3e8b51f..bebabf4 100644 --- a/kmicromail/libmailwrapper/mailwrapper.h +++ b/kmicromail/libmailwrapper/mailwrapper.h @@ -3,12 +3,14 @@ //#include <qpe/applnk.h> #include <qbitarray.h> #include <qdatetime.h> #include <qfileinfo.h> +//Added by qt3to4: +#include <QPixmap> #include <kiconloader.h> #include "settings.h" #include <opie2/osmartpointer.h> /* @@ -58,13 +60,13 @@ public: * 'cause it seems that it will never have some child classes. * in this case this object will not get a virtual table -> memory and * speed will be a little bit better? */ virtual ~Mail(){} void addAttachment( Attachment *att ) { attList.append( att ); } - const QList<Attachment>& getAttachments()const { return attList; } + const QList<Attachment*>& getAttachments()const { return attList; } void removeAttachment( Attachment *att ) { attList.remove( att ); } const QString&getName()const { return name; } void setName( QString s ) { name = s; } const QString&getMail()const{ return mail; } void setMail( const QString&s ) { mail = s; } const QString&getTo()const{ return to; } @@ -83,13 +85,13 @@ public: const QStringList&Inreply()const{return m_in_reply_to;} void setCharset( const QString&a ) { charset= a; } const QString& getCharset() const { return charset; } private: - QList<Attachment> attList; + QList<Attachment*> attList; QString name, mail, to, cc, bcc, reply, subject, message, charset; QStringList m_in_reply_to; }; class Folder:public Opie::Core::ORefCount { diff --git a/kmicromail/libmailwrapper/mboxwrapper.cpp b/kmicromail/libmailwrapper/mboxwrapper.cpp index 87f8c8a..888cae2 100644 --- a/kmicromail/libmailwrapper/mboxwrapper.cpp +++ b/kmicromail/libmailwrapper/mboxwrapper.cpp @@ -1,11 +1,13 @@ #include "mboxwrapper.h" #include "mailtypes.h" #include "mailwrapper.h" #include <libetpan/libetpan.h> #include <qdir.h> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> #include <klocale.h> #include <qpe/global.h> @@ -20,13 +22,13 @@ MBOXwrapper::MBOXwrapper(const QString & mbox_dir,const QString&mbox_name) } MBOXwrapper::~MBOXwrapper() { } -void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &target ) +void MBOXwrapper::listMessages(const QString & mailbox, Q3ValueList<RecMailP> &target ) { mailstorage*storage = mailstorage_new(NULL); QString p = MBOXPath+"/"; p+=mailbox; int r = mbox_mailstorage_init(storage,(char*)p.latin1(),0,0,0); @@ -45,15 +47,15 @@ void MBOXwrapper::listMessages(const QString & mailbox, QValueList<RecMailP> &ta mailfolder_disconnect(folder); mailfolder_free(folder); mailstorage_free(storage); Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); } -QValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* MBOXwrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); QDir dir(MBOXPath); if (!dir.exists()) return folders; dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); QStringList entries = dir.entryList(); QStringList::ConstIterator it = entries.begin(); for (;it!=entries.end();++it) { @@ -214,13 +216,13 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail) mailfolder_free(folder); mailstorage_free(storage); mailmessage_free(msg); return result; } -void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) +void MBOXwrapper::deleteMails(const QString & mailbox,const Q3ValueList<RecMailP> &target) { QString p = MBOXPath+"/"; p+=mailbox; mailmbox_folder*f = 0; int r = mailmbox_init(p.latin1(),0,1,0,&f); if (r != MAIL_NO_ERROR) { @@ -228,17 +230,17 @@ void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> return; } deleteMails(f,target); mailmbox_done(f); } -void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target) +void MBOXwrapper::deleteMails(mailmbox_folder*f,const Q3ValueList<RecMailP> &target) { if (!f) return; int r; - QValueList<RecMailP>::ConstIterator it; + Q3ValueList<RecMailP>::ConstIterator it; for (it=target.begin(); it != target.end();++it) { r = mailmbox_delete_msg(f,(*it)->getNumber()); if (r!=MAILMBOX_NO_ERROR) { ; // << "error delete mail" << oendl; } } diff --git a/kmicromail/libmailwrapper/mboxwrapper.h b/kmicromail/libmailwrapper/mboxwrapper.h index d03940f..e658a71 100644 --- a/kmicromail/libmailwrapper/mboxwrapper.h +++ b/kmicromail/libmailwrapper/mboxwrapper.h @@ -1,25 +1,27 @@ #ifndef __MBOX_WRAPPER_H #define __MBOX_WRAPPER_H #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> class encodedString; struct mailmbox_folder; class MBOXwrapper : public Genericwrapper { Q_OBJECT public: MBOXwrapper(const QString & dir,const QString&name); virtual ~MBOXwrapper(); - virtual void listMessages(const QString & mailbox, QValueList<RecMailP>&target ); - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual void listMessages(const QString & mailbox, Q3ValueList<RecMailP>&target ); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); virtual void answeredMail(const RecMailP&mail); virtual int createMbox(const QString&folder,const Opie::Core::OSmartPointer<Folder>&f=0, @@ -29,19 +31,19 @@ public: virtual void storeMessage(const char*msg,size_t length, const QString&folder); virtual RecBodyP fetchBody( const RecMailP &mail ); static void mbox_progress( size_t current, size_t maximum ); virtual encodedString* fetchRawBody(const RecMailP&mail); - virtual void deleteMails(const QString & FolderName,const QValueList<RecMailP> &target); + virtual void deleteMails(const QString & FolderName,const Q3ValueList<RecMailP> &target); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); virtual MAILLIB::ATYPE getType()const; virtual const QString&getName()const; virtual Account* getAccount() { return 0; }; protected: - static void deleteMails(mailmbox_folder*f,const QValueList<RecMailP> &target); + static void deleteMails(mailmbox_folder*f,const Q3ValueList<RecMailP> &target); QString MBOXPath; QString MBOXName; }; #endif diff --git a/kmicromail/libmailwrapper/mhwrapper.cpp b/kmicromail/libmailwrapper/mhwrapper.cpp index 787e85d..4cd7a94 100644 --- a/kmicromail/libmailwrapper/mhwrapper.cpp +++ b/kmicromail/libmailwrapper/mhwrapper.cpp @@ -2,12 +2,14 @@ #include "mhwrapper.h" #include "mailtypes.h" #include "mailwrapper.h" #include <libetpan/libetpan.h> #include <qdir.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> #include <qpe/global.h> #include <klocale.h> #include <kglobal.h> //#include <opie2/odebug.h> @@ -61,13 +63,13 @@ void MHwrapper::clean_storage() MHwrapper::~MHwrapper() { clean_storage(); } -void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) +void MHwrapper::listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) { init_storage(); if (!m_storage) { return; } QString f = buildPath(mailbox); @@ -77,15 +79,15 @@ void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSm return; } parseList(target,m_storage->sto_session,f, false, maxSizeInKb ); Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); } -QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); /* this is needed! */ if (m_storage) mailstorage_disconnect(m_storage); init_storage(); if (!m_storage) { return folders; } @@ -252,21 +254,21 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) } result = new encodedString(data,size); if (msg) mailmessage_free(msg); return result; } -void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) +void MHwrapper::deleteMails(const QString & mailbox,const Q3ValueList<RecMailP> &target) { QString f = buildPath(mailbox); int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); if (r!=MAIL_NO_ERROR) { qDebug("deleteMails: error selecting folder! "); return; } - QValueList<RecMailP>::ConstIterator it; + Q3ValueList<RecMailP>::ConstIterator it; for (it=target.begin(); it!=target.end();++it) { r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); if (r != MAIL_NO_ERROR) { qDebug("error deleting mail "); break; } diff --git a/kmicromail/libmailwrapper/mhwrapper.h b/kmicromail/libmailwrapper/mhwrapper.h index 36a443a..6151ff1 100644 --- a/kmicromail/libmailwrapper/mhwrapper.h +++ b/kmicromail/libmailwrapper/mhwrapper.h @@ -3,24 +3,26 @@ #define __MH_WRAPPER_H #include "maildefines.h" #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> class encodedString; struct mailmbox_folder; class MHwrapper : public Genericwrapper { Q_OBJECT public: MHwrapper(const QString & dir,const QString&name); virtual ~MHwrapper(); - virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); virtual void answeredMail(const RecMailP&mail); virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual void mvcpAllMails(const Opie::Core::OSmartPointer<Folder>&fromFolder, @@ -33,13 +35,13 @@ public: virtual void storeMessage(const char*msg,size_t length, const QString&folder); virtual RecBodyP fetchBody( const RecMailP &mail ); static void mbox_progress( size_t current, size_t maximum ); virtual encodedString* fetchRawBody(const RecMailP&mail); - virtual void deleteMails(const QString & FolderName,const QValueList<Opie::Core::OSmartPointer<RecMail> > &target); + virtual void deleteMails(const QString & FolderName,const Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); virtual MAILLIB::ATYPE getType()const; virtual const QString&getName()const; virtual Account* getAccount() { return 0; }; public slots: diff --git a/kmicromail/libmailwrapper/nntpwrapper.cpp b/kmicromail/libmailwrapper/nntpwrapper.cpp index 93cd2b5..b328ecd 100644 --- a/kmicromail/libmailwrapper/nntpwrapper.cpp +++ b/kmicromail/libmailwrapper/nntpwrapper.cpp @@ -1,12 +1,14 @@ // CHANGED 2004-09-31 Lutz Rogowski #include "nntpwrapper.h" #include "logindialog.h" #include "mailtypes.h" #include <qfile.h> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> #include <libetpan/libetpan.h> @@ -57,20 +59,20 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { cleanMimeCache(); if (mail->getNumber()!=last_msg_id) { if (msg_cache.exists()) { msg_cache.remove(); } - msg_cache.open(IO_ReadWrite|IO_Truncate); + msg_cache.open(QIODevice::ReadWrite|QIODevice::Truncate); last_msg_id = mail->getNumber(); err = mailsession_get_message(m_nntp->sto_session, mail->getNumber(), &mailmsg); err = mailmessage_fetch(mailmsg,&message,&length); msg_cache.writeBlock(message,length); } else { QString msg=""; - msg_cache.open(IO_ReadOnly); + msg_cache.open(QIODevice::ReadOnly); message = new char[4096]; memset(message,0,4096); while (msg_cache.readBlock(message,4095)>0) { msg+=message; memset(message,0,4096); } @@ -96,13 +98,13 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { free(message); return body; } -void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb) +void NNTPwrapper::listMessages(const QString & which, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb) { login(); if (!m_nntp) return; uint32_t res_messages,res_recent,res_unseen; mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); @@ -183,15 +185,15 @@ void NNTPwrapper::logout() if ( m_nntp == NULL ) return; mailstorage_free(m_nntp); m_nntp = 0; } -QValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<Opie::Core::OSmartPointer<Folder> >(); QStringList groups; if (account) { groups = account->getGroups(); } for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) { folders->append(new Folder((*it),".")); diff --git a/kmicromail/libmailwrapper/nntpwrapper.h b/kmicromail/libmailwrapper/nntpwrapper.h index 8c54f12..7c8e671 100644 --- a/kmicromail/libmailwrapper/nntpwrapper.h +++ b/kmicromail/libmailwrapper/nntpwrapper.h @@ -2,12 +2,14 @@ #ifndef __NNTPWRAPPER #define __NNTPWRAPPER #include "mailwrapper.h" #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> #include <libetpan/clist.h> class encodedString; struct mailstorage; struct mailfolder; @@ -18,15 +20,15 @@ class NNTPwrapper : public Genericwrapper public: NNTPwrapper( NNTPaccount *a ); virtual ~NNTPwrapper(); /* mailbox will be ignored */ - virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); + virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); /* should only get the subscribed one */ - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); /* mailbox will be ignored */ virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); QStringList listAllNewsgroups(const QString&mask = QString::null); virtual void deleteMail(const RecMailP&mail); virtual void answeredMail(const RecMailP&mail); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); diff --git a/kmicromail/libmailwrapper/pop3wrapper.cpp b/kmicromail/libmailwrapper/pop3wrapper.cpp index 2888f7c..ebeed71 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.cpp +++ b/kmicromail/libmailwrapper/pop3wrapper.cpp @@ -6,14 +6,16 @@ #include <libetpan/libetpan.h> #include <klocale.h> #include <qpe/global.h> #include <qfile.h> -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qapplication.h> +//Added by qt3to4: +#include <Q3ValueList> /* we don't fetch messages larger than 5 MB */ #define HARD_MSG_SIZE_LIMIT 5242880 using namespace Opie::Core; POP3wrapper::POP3wrapper( POP3account *a ) @@ -59,20 +61,20 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { cleanMimeCache(); if (mail->getNumber()!=last_msg_id) { if (msg_cache.exists()) { msg_cache.remove(); } - msg_cache.open(IO_ReadWrite|IO_Truncate); + msg_cache.open(QIODevice::ReadWrite|QIODevice::Truncate); last_msg_id = mail->getNumber(); err = mailsession_get_message(m_pop3->sto_session, mail->getNumber(), &mailmsg); err = mailmessage_fetch(mailmsg,&message,&length); msg_cache.writeBlock(message,length); } else { QString msg=""; - msg_cache.open(IO_ReadOnly); + msg_cache.open(QIODevice::ReadOnly); message = new char[4096]; memset(message,0,4096); while (msg_cache.readBlock(message,4095)>0) { msg+=message; memset(message,0,4096); } @@ -97,13 +99,13 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { if (message) free(message); return body; } -void POP3wrapper::listMessages(const QString &, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) +void POP3wrapper::listMessages(const QString &, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb ) { login(); if (!m_pop3) return; uint32_t res_messages,res_recent,res_unseen; mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); @@ -184,28 +186,28 @@ void POP3wrapper::logout() return; mailstorage_free(m_pop3); m_pop3 = 0; } -QValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { - QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<FolderP>(); +Q3ValueList<Opie::Core::OSmartPointer<Folder> >* POP3wrapper::listFolders() { + Q3ValueList<Opie::Core::OSmartPointer<Folder> >* folders = new Q3ValueList<FolderP>(); FolderP inb=new Folder("INBOX","/"); folders->append(inb); return folders; } -void POP3wrapper::deleteMailList(const QValueList<RecMailP>&target) +void POP3wrapper::deleteMailList(const Q3ValueList<RecMailP>&target) { login(); if (!m_pop3) return; int iii = 0; int count = target.count(); - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Deleting ...")); wid.show(); while (iii < count ) { Global::statusMessage(i18n("Delete message %1 of %2").arg(iii).arg(count)); wid.setProgress( iii ); wid.raise(); @@ -243,13 +245,13 @@ int POP3wrapper::deleteAllMail(const FolderP&) { Global::statusMessage(i18n("Error getting folder info")); return 0; } - QProgressBar wid ( result ); + Q3ProgressBar wid ( result ); wid.setCaption( i18n("Deleting ...")); wid.show(); for (unsigned int i = 0; i < result; ++i) { Global::statusMessage(i18n("Delete message %1 of %2").arg(i).arg(result)); wid.setProgress( i ); wid.raise(); diff --git a/kmicromail/libmailwrapper/pop3wrapper.h b/kmicromail/libmailwrapper/pop3wrapper.h index ebc2fc7..a077877 100644 --- a/kmicromail/libmailwrapper/pop3wrapper.h +++ b/kmicromail/libmailwrapper/pop3wrapper.h @@ -2,12 +2,14 @@ #ifndef __POP3WRAPPER #define __POP3WRAPPER #include "mailwrapper.h" #include "genericwrapper.h" #include <qstring.h> +//Added by qt3to4: +#include <Q3ValueList> class encodedString; struct mailstorage; struct mailfolder; class POP3wrapper : public Genericwrapper @@ -15,19 +17,19 @@ class POP3wrapper : public Genericwrapper Q_OBJECT public: POP3wrapper( POP3account *a ); virtual ~POP3wrapper(); /* mailbox will be ignored */ - virtual void listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); - virtual QValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); + virtual void listMessages(const QString & mailbox, Q3ValueList<Opie::Core::OSmartPointer<RecMail> > &target, int maxSizeInKb = 0 ); + virtual Q3ValueList<Opie::Core::OSmartPointer<Folder> >* listFolders(); /* mailbox will be ignored */ virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); - virtual void deleteMailList(const QValueList<RecMailP>&target); + virtual void deleteMailList(const Q3ValueList<RecMailP>&target); virtual void answeredMail(const RecMailP&mail); virtual int deleteAllMail(const Opie::Core::OSmartPointer<Folder>&); virtual RecBodyP fetchBody( const RecMailP &mail ); virtual encodedString* fetchRawBody(const RecMailP&mail); virtual void logout(); diff --git a/kmicromail/libmailwrapper/sendmailprogress.cpp b/kmicromail/libmailwrapper/sendmailprogress.cpp index 20dfe9b..6cd6409 100644 --- a/kmicromail/libmailwrapper/sendmailprogress.cpp +++ b/kmicromail/libmailwrapper/sendmailprogress.cpp @@ -1,8 +1,8 @@ #include "sendmailprogress.h" -#include <qprogressbar.h> +#include <q3progressbar.h> #include <qlabel.h> #include <klocale.h> progressMailSend::progressMailSend(QWidget*parent, const char * name) :progressMailSendUI(parent,name,true),m_current_mail(0),m_current_single(0),m_max_mail(0),m_max_single(0) { diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index 9436d43..fc01528 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp @@ -1,11 +1,11 @@ #include <stdlib.h> #include <qdir.h> #include <qtextcodec.h> -#include <qtextstream.h> +#include <q3textstream.h> #include <qfile.h> //#include <opie2/odebug.h> #include <kconfig.h> #include <kstandarddirs.h> @@ -373,17 +373,17 @@ QString SMTPaccount::getSignature() { QFileInfo fi ( signature ); if ( ! fi.exists() ) return QString(); QFile file( signature ); - if (!file.open( IO_ReadOnly ) ) { + if (!file.open( QIODevice::ReadOnly ) ) { return QString(); } - QTextStream ts( &file ); + Q3TextStream ts( &file ); ts.setCodec( QTextCodec::codecForName("utf8") ); QString text = ts.read(); file.close(); return text; @@ -396,17 +396,17 @@ void SMTPaccount::setSignature( QString b ) QString filedir( locateLocal("data", "kopiemail" ) ); signature = filedir+ "/" + getAccountName() +".sig"; qDebug("new sig %s ", signature.latin1()); save(); } QFile fileIn( signature ); - if (!fileIn.open( IO_WriteOnly ) ) { + if (!fileIn.open( QIODevice::WriteOnly ) ) { qDebug("OM: Cannot write signature file %s ", signature.latin1() ); return ; } - QTextStream tsIn( &fileIn ); + Q3TextStream tsIn( &fileIn ); tsIn.setCodec( QTextCodec::codecForName("utf8") ); tsIn << b ; fileIn.close(); } QString SMTPaccount::getUniqueFileName() { diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp index 7c813cc..2df55ff 100644 --- a/kmicromail/libmailwrapper/smtpwrapper.cpp +++ b/kmicromail/libmailwrapper/smtpwrapper.cpp @@ -6,12 +6,14 @@ #include "sendmailprogress.h" //#include <opie2/odebug.h> //#include <qt.h> #include <qapplication.h> #include <qmessagebox.h> +//Added by qt3to4: +#include <Q3ValueList> #include <stdlib.h> #ifndef DESKTOP_VERSION //#include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> #endif #include <libetpan/libetpan.h> @@ -431,14 +433,14 @@ bool SMTPwrapper::flushOutbox() { AbstractMail*wrap = AbstractMail::getWrapper(localfolders); if (!wrap) { ; // odebug << "memory error" << oendl; return false; } QString oldPw, oldUser; - QValueList<RecMailP> mailsToSend; - QValueList<RecMailP> mailsToRemove; + Q3ValueList<RecMailP> mailsToSend; + Q3ValueList<RecMailP> mailsToRemove; QString mbox("Outgoing"); wrap->listMessages(mbox,mailsToSend); if (mailsToSend.count()==0) { delete wrap; ; // odebug << "No mails to send" << oendl; return false; |