From a08aff328d4393031d5ba7d622c2b05705a89d73 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 04 Jul 2007 11:23:42 +0000 Subject: initial public commit of qt4 port --- (limited to 'kmicromail/libmailwrapper') 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 @@ -8,13 +8,15 @@ #include -#include +#include #include #include +//Added by qt3to4: +#include #include #include #include -#include +#include #include #include #include @@ -111,10 +113,10 @@ QString AbstractMail::convert_String(const char*text) 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() + "}"; } @@ -138,16 +140,16 @@ QString AbstractMail::draftFolder() } /* temporary - will be removed when implemented in all classes */ -void AbstractMail::deleteMails(const QString &,const QValueList > &) +void AbstractMail::deleteMails(const QString &,const Q3ValueList > &) { } -void AbstractMail::deleteMailList(const QValueList&target) +void AbstractMail::deleteMailList(const Q3ValueList&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 ) { @@ -177,7 +179,7 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); return; } - QValueList t; + Q3ValueList t; listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); if ( t.count() == 0 ) { qDebug("There are no new messages %s", fromFolder->getName().latin1()); @@ -187,10 +189,10 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe Global::statusMessage(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); qDebug(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); qApp->processEvents(); - QValueList e; + Q3ValueList e; targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); //qDebug("target has mails %d ", e.count()); - QValueList n; + Q3ValueList n; int iii = 0; int count = t.count(); while (iii < count ) { @@ -221,7 +223,7 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe Global::statusMessage(i18n("Downloaded %1 messages").arg(n.count())); #if 0 - QValueList t; + Q3ValueList t; listMessages(fromFolder->getName(),t, maxSizeInKb); mvcpMailList( t,targetFolder,targetWrapper,moveit); #endif @@ -230,12 +232,12 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe void AbstractMail::mvcpAllMails(const FolderP&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int maxSizeInKb) { - QValueList t; + Q3ValueList t; listMessages(fromFolder->getName(),t, maxSizeInKb); mvcpMailList( t,targetFolder,targetWrapper,moveit); } -void AbstractMail::mvcpMailList(const QValueList& t, +void AbstractMail::mvcpMailList(const Q3ValueList& t, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) { encodedString*st = 0; @@ -246,7 +248,7 @@ void AbstractMail::mvcpMailList(const QValueList& t, // 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 ) { 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 @@ -7,6 +7,8 @@ #include "settings.h" #include +//Added by qt3to4: +#include #include #include "mailtypes.h" @@ -25,8 +27,8 @@ class AbstractMail:public QObject public: AbstractMail(){}; virtual ~AbstractMail(){} - virtual QValueList >* listFolders()=0; - virtual void listMessages(const QString & mailbox,QValueList&target, int sizeInKb = 0 )=0; + virtual Q3ValueList >* listFolders()=0; + virtual void listMessages(const QString & mailbox,Q3ValueList&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; @@ -35,16 +37,16 @@ public: virtual encodedString* fetchRawBody(const RecMailP&mail)=0; virtual void deleteMail(const RecMailP&mail)=0; - virtual void deleteMailList(const QValueList&target); + virtual void deleteMailList(const Q3ValueList&target); virtual void answeredMail(const RecMailP&mail)=0; virtual int deleteAllMail(const Opie::Core::OSmartPointer&)=0; - virtual void deleteMails(const QString & FolderName,const QValueList >&target); + virtual void deleteMails(const QString & FolderName,const Q3ValueList >&target); virtual int deleteMbox(const Opie::Core::OSmartPointer&)=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&fromFolder, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit, int sizeInKb = 0); - virtual void mvcpMailList(const QValueList& t, + virtual void mvcpMailList(const Q3ValueList& t, const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); virtual void mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit); 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 @@ -7,6 +7,8 @@ #include #include +//Added by qt3to4: +#include using namespace Opie::Core; const char* Generatemail::USER_AGENT="KOpieMail 33 1/3"; @@ -228,7 +230,7 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) { 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() ) ); @@ -252,7 +254,7 @@ mailmime *Generatemail::buildTxtPart(const QString&str ) { 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 ) 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 @@ -6,6 +6,8 @@ #include #include #include +//Added by qt3to4: +#include using namespace Opie::Core; @@ -182,7 +184,7 @@ QString Genericwrapper::getencoding(mailmime_mechanism*aEnc) return enc; } -void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueListrecList,unsigned int current_rec,int current_count) +void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueListrecList,unsigned int current_rec,int current_count) { if (current_rec >= 10) { ; // odebug << "too deep recursion!" << oendl; @@ -200,7 +202,7 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m switch (mime->mm_type) { case MAILMIME_SINGLE: { - QValueListcountlist = recList; + Q3ValueListcountlist = recList; countlist.append(current_count); r = mailmessage_fetch_section(message,mime,&data,&len); part->setSize(len); @@ -250,7 +252,7 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m { unsigned int ccount = 1; mailmime*cbody=0; - QValueListcountlist = recList; + Q3ValueListcountlist = 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) { @@ -270,7 +272,7 @@ void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*m break; case MAILMIME_MESSAGE: { - QValueListcountlist = recList; + Q3ValueListcountlist = recList; countlist.append(current_count); /* the own header is always at recursion 0 - we don't need that */ if (current_rec > 0) { @@ -302,7 +304,7 @@ RecBodyP Genericwrapper::parseMail( mailmessage * msg ) RecBodyP body = new RecBody(); //memset(&fields, 0, sizeof(struct mailmime_single_fields)); err = mailmessage_get_bodystructure(msg,&mime); - QValueListrecList; + Q3ValueListrecList; traverseBody(body,msg,mime,recList); return body; } @@ -447,7 +449,7 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies) return res; } -void Genericwrapper::parseList(QValueList > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) +void Genericwrapper::parseList(Q3ValueList > &target,mailsession*session,const QString&mailbox,bool mbox_as_to, int maxSizeInKb) { int r; mailmessage_list * env_list = 0; 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 @@ -5,6 +5,8 @@ #include "abstractmail.h" #include #include +//Added by qt3to4: +#include #include class RecMail; @@ -51,11 +53,11 @@ protected: QString parseGroup( mailimf_group *group ); QString parseAddressList( mailimf_address_list *list ); - void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueListrecList,unsigned int current_rek=0,int current_count=1); + void traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,Q3ValueListrecList,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 > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0); + virtual void parseList(Q3ValueList > &target,mailsession*session,const QString&mailbox,bool mbox_as_to=false, int maxSizeInKb = 0); QStringList parseInreplies(mailimf_in_reply_to * in_replies); QString msgTempName; 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 @@ -3,10 +3,12 @@ #include #include #include +//Added by qt3to4: +#include #include "imapwrapper.h" #include "mailtypes.h" #include "logindialog.h" -#include +#include #include "genericwrapper.h" #include @@ -239,7 +241,7 @@ void IMAPwrapper::logout() m_Lastmbox = ""; } -void IMAPwrapper::listMessages(const QString&mailbox,QValueList > &target , int maxSizeInKb) +void IMAPwrapper::listMessages(const QString&mailbox,Q3ValueList > &target , int maxSizeInKb) { int tryAgain = 1; @@ -320,7 +322,7 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList >* IMAPwrapper::listFolders() +Q3ValueList >* IMAPwrapper::listFolders() { const char *path, *mask; int err = MAILIMAP_NO_ERROR; @@ -329,7 +331,7 @@ QValueList >* IMAPwrapper::listFolders() clistcell*cur_flag = 0; mailimap_mbx_list_flags*bflags = 0; - QValueList* folders = new QValueList(); + Q3ValueList* folders = new Q3ValueList(); login(); if (!m_imap) { return folders; @@ -613,7 +615,7 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) 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 path; + Q3ValueList path; body_desc = item->att_data.att_static->att_data.att_body; traverseBody(mail,body_desc,body,0,path); } else { @@ -664,7 +666,7 @@ QStringList IMAPwrapper::address_list_to_stringlist(clist*list) return l; } -encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList&path,bool internal_call) +encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const Q3ValueList&path,bool internal_call) { encodedString*res=new encodedString; int err; @@ -738,7 +740,7 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueListrecList,int current_count) + int current_recursion,Q3ValueListrecList,int current_count) { if (!body || current_recursion>=10) { return; @@ -746,7 +748,7 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t switch (body->bd_type) { case MAILIMAP_BODY_1PART: { - QValueListcountlist = recList; + Q3ValueListcountlist = recList; countlist.append(current_count); RecPartP currentPart = new RecPart(); mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; @@ -799,7 +801,7 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t break; case MAILIMAP_BODY_MPART: { - QValueListcountlist = recList; + Q3ValueListcountlist = recList; clistcell*current=0; mailimap_body*current_body=0; unsigned int ccount = 1; @@ -985,7 +987,7 @@ void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which target_part->setEncoding(encoding); target_part->setSize(which->bd_size); } -void IMAPwrapper::deleteMailList(const QValueList&target) +void IMAPwrapper::deleteMailList(const Q3ValueList&target) { //#if 0 mailimap_flag_list*flist; @@ -1005,7 +1007,7 @@ void IMAPwrapper::deleteMailList(const QValueList&target) mMax = count; progress( i18n("Delete")); - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Deleting ...")); wid.show(); while (iii < count ) { @@ -1114,7 +1116,7 @@ void IMAPwrapper::answeredMail(const RecMailP&mail) } } -QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList&path,bool internal_call,const QString&enc) +QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const Q3ValueList&path,bool internal_call,const QString&enc) { QString body(""); encodedString*res = fetchRawPart(mail,path,internal_call); @@ -1299,7 +1301,7 @@ const QString&IMAPwrapper::getName()const encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) { // dummy - QValueList path; + Q3ValueList path; return fetchRawPart(mail,path,false); } 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 @@ -3,6 +3,8 @@ #define __IMAPWRAPPER #include +//Added by qt3to4: +#include #include "mailwrapper.h" #include "abstractmail.h" #include @@ -24,12 +26,12 @@ class IMAPwrapper : public AbstractMail public: IMAPwrapper( IMAPaccount *a ); virtual ~IMAPwrapper(); - virtual QValueList >* listFolders(); - virtual void listMessages(const QString & mailbox,QValueList >&target , int sizeInKb = 0); + virtual Q3ValueList >* listFolders(); + virtual void listMessages(const QString & mailbox,Q3ValueList >&target , int sizeInKb = 0); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); - void deleteMailList(const QValueList&target); + void deleteMailList(const Q3ValueList&target); virtual void answeredMail(const RecMailP&mail); virtual int deleteAllMail(const Opie::Core::OSmartPointer&folder); virtual void storeMessage(const char*msg,size_t length, const QString&folder); @@ -59,8 +61,8 @@ protected: void login(bool tryTLS = true); bool start_tls(bool force=true); - virtual QString fetchTextPart(const RecMailP&mail,const QValueList&path,bool internal_call=false,const QString&enc=""); - virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList&path,bool internal_call); + virtual QString fetchTextPart(const RecMailP&mail,const Q3ValueList&path,bool internal_call=false,const QString&enc=""); + virtual encodedString*fetchRawPart(const RecMailP&mail,const Q3ValueList&path,bool internal_call); int selectMbox(const QString&mbox); void fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description); @@ -68,7 +70,7 @@ protected: 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,QValueListrecList,int current_count=1); + void traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,int current_recursion,Q3ValueListrecList,int current_count=1); /* just helpers */ static void fillBodyFields(RecPartP&target_part,mailimap_body_fields*which); 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 @@ -38,7 +38,8 @@ SOURCES = imapwrapper.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 @@ -63,3 +64,8 @@ QMAKE_LINK += /NODEFAULTLIB:LIBC 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 @@ -6,7 +6,7 @@ //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) ); 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 @@ -8,7 +8,7 @@ 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; } 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 @@ -3,6 +3,8 @@ //#include #include +//Added by qt3to4: +#include using namespace Opie::Core; RecMail::RecMail() @@ -283,12 +285,12 @@ const QString RecPart::searchParamter(const QString&key)const return value; } -void RecPart::setPositionlist(const QValueList&poslist) +void RecPart::setPositionlist(const Q3ValueList&poslist) { m_poslist = poslist; } -const QValueList& RecPart::Positionlist()const +const Q3ValueList& RecPart::Positionlist()const { return m_poslist; } @@ -323,13 +325,13 @@ const QString& RecBody::Bodytext()const return m_BodyText; } -void RecBody::setParts(const QValueList&parts) +void RecBody::setParts(const Q3ValueList&parts) { m_PartsList.clear(); m_PartsList = parts; } -const QValueList& RecBody::Parts()const +const Q3ValueList& RecBody::Parts()const { return m_PartsList; } 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 @@ -14,7 +14,7 @@ #include #include #include -#include +#include class AbstractMail; /* a class to describe mails in a mailbox */ @@ -109,7 +109,7 @@ protected: unsigned int m_lines,m_size; part_plist_t m_Parameters; /* describes the position in the mail */ - QValueList m_poslist; + Q3ValueList m_poslist; public: RecPart(); @@ -136,8 +136,8 @@ public: 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&poslist); - const QValueList& Positionlist()const; + void setPositionlist(const Q3ValueList&poslist); + const Q3ValueList& Positionlist()const; }; typedef Opie::Core::OSmartPointer RecPartP; @@ -147,7 +147,7 @@ class RecBody:public Opie::Core::ORefCount protected: QString m_BodyText; QString mCharset; - QValueList m_PartsList; + Q3ValueList m_PartsList; RecPartP m_description; public: @@ -162,8 +162,8 @@ public: void setDescription(const RecPartP&des); const RecPartP& Description()const; - void setParts(const QValueList&parts); - const QValueList& Parts()const; + void setParts(const Q3ValueList&parts); + const Q3ValueList& Parts()const; void addPart(const RecPartP&part); }; 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 @@ -5,6 +5,8 @@ #include #include #include +//Added by qt3to4: +#include #include "mailwrapper.h" //#include "logindialog.h" @@ -81,8 +83,8 @@ QString IMAPFolder::decodeFolderName( const QString &name ) 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)); @@ -92,9 +94,9 @@ QString IMAPFolder::decodeFolderName( const QString &name ) /* 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 */ @@ -105,7 +107,7 @@ QString IMAPFolder::decodeFolderName( const QString &name ) 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; @@ -149,7 +151,7 @@ QString IMAPFolder::decodeFolderName( const QString &name ) } } /* skip over trailing '-' in modified UTF-7 encoding */ - if (src[srcPtr] == '-') + if (src.at(srcPtr) == '-') ++srcPtr; } } 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 @@ -6,6 +6,8 @@ #include #include #include +//Added by qt3to4: +#include #include #include "settings.h" @@ -61,7 +63,7 @@ public: */ virtual ~Mail(){} void addAttachment( Attachment *att ) { attList.append( att ); } - const QList& getAttachments()const { return attList; } + const QList& getAttachments()const { return attList; } void removeAttachment( Attachment *att ) { attList.remove( att ); } const QString&getName()const { return name; } void setName( QString s ) { name = s; } @@ -86,7 +88,7 @@ public: const QString& getCharset() const { return charset; } private: - QList attList; + QList attList; QString name, mail, to, cc, bcc, reply, subject, message, charset; QStringList m_in_reply_to; }; 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 @@ -3,6 +3,8 @@ #include "mailwrapper.h" #include #include +//Added by qt3to4: +#include #include #include @@ -23,7 +25,7 @@ MBOXwrapper::~MBOXwrapper() { } -void MBOXwrapper::listMessages(const QString & mailbox, QValueList &target ) +void MBOXwrapper::listMessages(const QString & mailbox, Q3ValueList &target ) { mailstorage*storage = mailstorage_new(NULL); QString p = MBOXPath+"/"; @@ -48,9 +50,9 @@ void MBOXwrapper::listMessages(const QString & mailbox, QValueList &ta Global::statusMessage(i18n("Mailbox has %1 mail(s)").arg(target.count())); } -QValueList >* MBOXwrapper::listFolders() +Q3ValueList >* MBOXwrapper::listFolders() { - QValueList >* folders = new QValueList >(); + Q3ValueList >* folders = new Q3ValueList >(); QDir dir(MBOXPath); if (!dir.exists()) return folders; dir.setFilter(QDir::Files|QDir::Writable|QDir::Readable); @@ -217,7 +219,7 @@ encodedString* MBOXwrapper::fetchRawBody(const RecMailP&mail) return result; } -void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList &target) +void MBOXwrapper::deleteMails(const QString & mailbox,const Q3ValueList &target) { QString p = MBOXPath+"/"; p+=mailbox; @@ -231,11 +233,11 @@ void MBOXwrapper::deleteMails(const QString & mailbox,const QValueList mailmbox_done(f); } -void MBOXwrapper::deleteMails(mailmbox_folder*f,const QValueList &target) +void MBOXwrapper::deleteMails(mailmbox_folder*f,const Q3ValueList &target) { if (!f) return; int r; - QValueList::ConstIterator it; + Q3ValueList::ConstIterator it; for (it=target.begin(); it != target.end();++it) { r = mailmbox_delete_msg(f,(*it)->getNumber()); if (r!=MAILMBOX_NO_ERROR) { 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 @@ -3,6 +3,8 @@ #include "genericwrapper.h" #include +//Added by qt3to4: +#include class encodedString; struct mailmbox_folder; @@ -15,8 +17,8 @@ public: MBOXwrapper(const QString & dir,const QString&name); virtual ~MBOXwrapper(); - virtual void listMessages(const QString & mailbox, QValueList&target ); - virtual QValueList >* listFolders(); + virtual void listMessages(const QString & mailbox, Q3ValueList&target ); + virtual Q3ValueList >* listFolders(); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); @@ -32,14 +34,14 @@ public: static void mbox_progress( size_t current, size_t maximum ); virtual encodedString* fetchRawBody(const RecMailP&mail); - virtual void deleteMails(const QString & FolderName,const QValueList &target); + virtual void deleteMails(const QString & FolderName,const Q3ValueList &target); virtual int deleteAllMail(const Opie::Core::OSmartPointer&); virtual MAILLIB::ATYPE getType()const; virtual const QString&getName()const; virtual Account* getAccount() { return 0; }; protected: - static void deleteMails(mailmbox_folder*f,const QValueList &target); + static void deleteMails(mailmbox_folder*f,const Q3ValueList &target); QString MBOXPath; QString MBOXName; }; 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 @@ -5,6 +5,8 @@ #include #include #include +//Added by qt3to4: +#include #include #include #include @@ -64,7 +66,7 @@ MHwrapper::~MHwrapper() clean_storage(); } -void MHwrapper::listMessages(const QString & mailbox, QValueList > &target, int maxSizeInKb ) +void MHwrapper::listMessages(const QString & mailbox, Q3ValueList > &target, int maxSizeInKb ) { init_storage(); if (!m_storage) { @@ -80,9 +82,9 @@ void MHwrapper::listMessages(const QString & mailbox, QValueList >* MHwrapper::listFolders() +Q3ValueList >* MHwrapper::listFolders() { - QValueList >* folders = new QValueList >(); + Q3ValueList >* folders = new Q3ValueList >(); /* this is needed! */ if (m_storage) mailstorage_disconnect(m_storage); init_storage(); @@ -255,7 +257,7 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) return result; } -void MHwrapper::deleteMails(const QString & mailbox,const QValueList &target) +void MHwrapper::deleteMails(const QString & mailbox,const Q3ValueList &target) { QString f = buildPath(mailbox); int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); @@ -263,7 +265,7 @@ void MHwrapper::deleteMails(const QString & mailbox,const QValueList & qDebug("deleteMails: error selecting folder! "); return; } - QValueList::ConstIterator it; + Q3ValueList::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) { 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 @@ -6,6 +6,8 @@ #include "genericwrapper.h" #include +//Added by qt3to4: +#include class encodedString; struct mailmbox_folder; @@ -16,8 +18,8 @@ public: MHwrapper(const QString & dir,const QString&name); virtual ~MHwrapper(); - virtual void listMessages(const QString & mailbox, QValueList > &target, int maxSizeInKb = 0 ); - virtual QValueList >* listFolders(); + virtual void listMessages(const QString & mailbox, Q3ValueList > &target, int maxSizeInKb = 0 ); + virtual Q3ValueList >* listFolders(); virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); virtual void deleteMail(const RecMailP&mail); @@ -36,7 +38,7 @@ public: static void mbox_progress( size_t current, size_t maximum ); virtual encodedString* fetchRawBody(const RecMailP&mail); - virtual void deleteMails(const QString & FolderName,const QValueList > &target); + virtual void deleteMails(const QString & FolderName,const Q3ValueList > &target); virtual int deleteAllMail(const Opie::Core::OSmartPointer&); virtual MAILLIB::ATYPE getType()const; virtual const QString&getName()const; 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 @@ -4,6 +4,8 @@ #include "mailtypes.h" #include +//Added by qt3to4: +#include #include @@ -60,14 +62,14 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { 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) { @@ -99,7 +101,7 @@ RecBodyP NNTPwrapper::fetchBody( const RecMailP &mail ) { } -void NNTPwrapper::listMessages(const QString & which, QValueList > &target, int maxSizeInKb) +void NNTPwrapper::listMessages(const QString & which, Q3ValueList > &target, int maxSizeInKb) { login(); if (!m_nntp) @@ -186,9 +188,9 @@ void NNTPwrapper::logout() m_nntp = 0; } -QValueList >* NNTPwrapper::listFolders() { +Q3ValueList >* NNTPwrapper::listFolders() { - QValueList >* folders = new QValueList >(); + Q3ValueList >* folders = new Q3ValueList >(); QStringList groups; if (account) { groups = account->getGroups(); 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 @@ -5,6 +5,8 @@ #include "mailwrapper.h" #include "genericwrapper.h" #include +//Added by qt3to4: +#include #include class encodedString; @@ -21,9 +23,9 @@ public: virtual ~NNTPwrapper(); /* mailbox will be ignored */ - virtual void listMessages(const QString & mailbox, QValueList > &target, int maxSizeInKb = 0 ); + virtual void listMessages(const QString & mailbox, Q3ValueList > &target, int maxSizeInKb = 0 ); /* should only get the subscribed one */ - virtual QValueList >* listFolders(); + virtual Q3ValueList >* listFolders(); /* mailbox will be ignored */ virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); QStringList listAllNewsgroups(const QString&mask = QString::null); 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 @@ -9,8 +9,10 @@ #include #include -#include +#include #include +//Added by qt3to4: +#include /* we don't fetch messages larger than 5 MB */ #define HARD_MSG_SIZE_LIMIT 5242880 @@ -62,14 +64,14 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { 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) { @@ -100,7 +102,7 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) { return body; } -void POP3wrapper::listMessages(const QString &, QValueList > &target, int maxSizeInKb ) +void POP3wrapper::listMessages(const QString &, Q3ValueList > &target, int maxSizeInKb ) { login(); if (!m_pop3) @@ -187,14 +189,14 @@ void POP3wrapper::logout() } -QValueList >* POP3wrapper::listFolders() { - QValueList >* folders = new QValueList(); +Q3ValueList >* POP3wrapper::listFolders() { + Q3ValueList >* folders = new Q3ValueList(); FolderP inb=new Folder("INBOX","/"); folders->append(inb); return folders; } -void POP3wrapper::deleteMailList(const QValueList&target) +void POP3wrapper::deleteMailList(const Q3ValueList&target) { login(); if (!m_pop3) @@ -202,7 +204,7 @@ void POP3wrapper::deleteMailList(const QValueList&target) int iii = 0; int count = target.count(); - QProgressBar wid ( count ); + Q3ProgressBar wid ( count ); wid.setCaption( i18n("Deleting ...")); wid.show(); while (iii < count ) { @@ -246,7 +248,7 @@ int POP3wrapper::deleteAllMail(const FolderP&) { - QProgressBar wid ( result ); + Q3ProgressBar wid ( result ); wid.setCaption( i18n("Deleting ...")); wid.show(); for (unsigned int i = 0; i < result; ++i) { 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 @@ -5,6 +5,8 @@ #include "mailwrapper.h" #include "genericwrapper.h" #include +//Added by qt3to4: +#include class encodedString; struct mailstorage; @@ -18,13 +20,13 @@ public: POP3wrapper( POP3account *a ); virtual ~POP3wrapper(); /* mailbox will be ignored */ - virtual void listMessages(const QString & mailbox, QValueList > &target, int maxSizeInKb = 0 ); - virtual QValueList >* listFolders(); + virtual void listMessages(const QString & mailbox, Q3ValueList > &target, int maxSizeInKb = 0 ); + virtual Q3ValueList >* 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&target); + virtual void deleteMailList(const Q3ValueList&target); virtual void answeredMail(const RecMailP&mail); virtual int deleteAllMail(const Opie::Core::OSmartPointer&); 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,5 +1,5 @@ #include "sendmailprogress.h" -#include +#include #include #include 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 @@ -2,7 +2,7 @@ #include #include -#include +#include #include //#include @@ -376,11 +376,11 @@ QString SMTPaccount::getSignature() 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(); @@ -399,11 +399,11 @@ void SMTPaccount::setSignature( QString b ) 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(); 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 @@ -9,6 +9,8 @@ //#include #include #include +//Added by qt3to4: +#include #include #ifndef DESKTOP_VERSION //#include @@ -434,8 +436,8 @@ bool SMTPwrapper::flushOutbox() { return false; } QString oldPw, oldUser; - QValueList mailsToSend; - QValueList mailsToRemove; + Q3ValueList mailsToSend; + Q3ValueList mailsToRemove; QString mbox("Outgoing"); wrap->listMessages(mbox,mailsToSend); if (mailsToSend.count()==0) { -- cgit v0.9.0.2