From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:53:50 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmail/imapjob.cpp | 106 +++++++++++++++++++++++++++--------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) (limited to 'kmail/imapjob.cpp') diff --git a/kmail/imapjob.cpp b/kmail/imapjob.cpp index 13d4baa8..50db423c 100644 --- a/kmail/imapjob.cpp +++ b/kmail/imapjob.cpp @@ -41,7 +41,7 @@ using KPIM::ProgressManager; #include "util.h" -#include +#include #include #include #include @@ -54,22 +54,22 @@ namespace KMail { //----------------------------------------------------------------------------- ImapJob::ImapJob( KMMessage *msg, JobType jt, KMFolderImap* folder, - QString partSpecifier, const AttachmentStrategy *as ) + TQString partSpecifier, const AttachmentStrategy *as ) : FolderJob( msg, jt, folder? folder->folder() : 0, partSpecifier ), mAttachmentStrategy( as ), mParentProgressItem(0) { } //----------------------------------------------------------------------------- -ImapJob::ImapJob( QPtrList& msgList, QString sets, JobType jt, +ImapJob::ImapJob( TQPtrList& msgList, TQString sets, JobType jt, KMFolderImap* folder ) : FolderJob( msgList, sets, jt, folder? folder->folder() : 0 ), mAttachmentStrategy ( 0 ), mParentProgressItem(0) { } -void ImapJob::init( JobType jt, QString sets, KMFolderImap* folder, - QPtrList& msgList ) +void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder, + TQPtrList& msgList ) { mJob = 0; @@ -111,7 +111,7 @@ void ImapJob::init( JobType jt, QString sets, KMFolderImap* folder, if ( jt == tPutMessage ) { // transfers the complete message to the server - QPtrListIterator it( msgList ); + TQPtrListIterator it( msgList ); KMMessage* curMsg; while ( ( curMsg = it.current() ) != 0 ) { @@ -122,14 +122,14 @@ void ImapJob::init( JobType jt, QString sets, KMFolderImap* folder, curMsg = mSrcFolder->getMsg( idx ); } KURL url = account->getUrl(); - QString flags = KMFolderImap::statusToFlags( curMsg->status(), folder->permanentFlags() ); + TQString flags = KMFolderImap::statusToFlags( curMsg->status(), folder->permanentFlags() ); url.setPath( folder->imapPath() + ";SECTION=" + flags ); ImapAccountBase::jobData jd; jd.parent = 0; jd.offset = 0; jd.done = 0; jd.total = ( curMsg->msgSizeServer() > 0 ) ? curMsg->msgSizeServer() : curMsg->msgSize(); jd.msgList.append( curMsg ); - QCString cstr( curMsg->asString() ); + TQCString cstr( curMsg->asString() ); int a = cstr.find("\nX-UID: "); int b = cstr.find('\n', a); if (a != -1 && b != -1 && cstr.find("\n\n") > a) cstr.remove(a, b-a); @@ -151,23 +151,23 @@ void ImapJob::init( JobType jt, QString sets, KMFolderImap* folder, mParentProgressItem, "ImapJobUploading"+ProgressManager::getUniqueID(), i18n("Uploading message data"), - QStyleSheet::escape( curMsg->subject() ), + TQStyleSheet::escape( curMsg->subject() ), true, account->useSSL() || account->useTLS() ); jd.progressItem->setTotalItems( jd.total ); - connect ( jd.progressItem, SIGNAL( progressItemCanceled( KPIM::ProgressItem*)), - account, SLOT( slotAbortRequested( KPIM::ProgressItem* ) ) ); + connect ( jd.progressItem, TQT_SIGNAL( progressItemCanceled( KPIM::ProgressItem*)), + account, TQT_SLOT( slotAbortRequested( KPIM::ProgressItem* ) ) ); KIO::SimpleJob *job = KIO::put( url, 0, false, false, false ); KIO::Scheduler::assignJobToSlave( account->slave(), job ); account->insertJob( job, jd ); - connect( job, SIGNAL(result(KIO::Job *)), - SLOT(slotPutMessageResult(KIO::Job *)) ); - connect( job, SIGNAL(dataReq(KIO::Job *, QByteArray &)), - SLOT(slotPutMessageDataReq(KIO::Job *, QByteArray &)) ); - connect( job, SIGNAL(infoMessage(KIO::Job *, const QString &)), - SLOT(slotPutMessageInfoData(KIO::Job *, const QString &)) ); - connect( job, SIGNAL(processedSize(KIO::Job *, KIO::filesize_t)), - SLOT(slotProcessedSize(KIO::Job *, KIO::filesize_t))); + connect( job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotPutMessageResult(KIO::Job *)) ); + connect( job, TQT_SIGNAL(dataReq(KIO::Job *, TQByteArray &)), + TQT_SLOT(slotPutMessageDataReq(KIO::Job *, TQByteArray &)) ); + connect( job, TQT_SIGNAL(infoMessage(KIO::Job *, const TQString &)), + TQT_SLOT(slotPutMessageInfoData(KIO::Job *, const TQString &)) ); + connect( job, TQT_SIGNAL(processedSize(KIO::Job *, KIO::filesize_t)), + TQT_SLOT(slotProcessedSize(KIO::Job *, KIO::filesize_t))); } } else if ( jt == tCopyMessage || jt == tMoveMessage ) @@ -182,8 +182,8 @@ void ImapJob::init( JobType jt, QString sets, KMFolderImap* folder, jd.total = 1; jd.done = 0; jd.msgList = msgList; - QByteArray packedArgs; - QDataStream stream( packedArgs, IO_WriteOnly ); + TQByteArray packedArgs; + TQDataStream stream( packedArgs, IO_WriteOnly ); stream << (int) 'C' << url << destUrl; jd.progressItem = ProgressManager::createProgressItem( @@ -191,23 +191,23 @@ void ImapJob::init( JobType jt, QString sets, KMFolderImap* folder, "ImapJobCopyMove"+ProgressManager::getUniqueID(), i18n("Server operation"), i18n("Source folder: %1 - Destination folder: %2") - .arg( QStyleSheet::escape( msg_parent->prettyURL() ), - QStyleSheet::escape( mDestFolder->prettyURL() ) ), + .arg( TQStyleSheet::escape( msg_parent->prettyURL() ), + TQStyleSheet::escape( mDestFolder->prettyURL() ) ), true, account->useSSL() || account->useTLS() ); jd.progressItem->setTotalItems( jd.total ); - connect ( jd.progressItem, SIGNAL(progressItemCanceled(KPIM::ProgressItem*)), - account, SLOT( slotAbortRequested(KPIM::ProgressItem* ) ) ); + connect ( jd.progressItem, TQT_SIGNAL(progressItemCanceled(KPIM::ProgressItem*)), + account, TQT_SLOT( slotAbortRequested(KPIM::ProgressItem* ) ) ); KIO::SimpleJob *simpleJob = KIO::special( url, packedArgs, false ); KIO::Scheduler::assignJobToSlave( account->slave(), simpleJob ); mJob = simpleJob; account->insertJob( mJob, jd ); - connect( mJob, SIGNAL(result(KIO::Job *)), - SLOT(slotCopyMessageResult(KIO::Job *)) ); + connect( mJob, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotCopyMessageResult(KIO::Job *)) ); if ( jt == tMoveMessage ) { - connect( mJob, SIGNAL(infoMessage(KIO::Job *, const QString &)), - SLOT(slotCopyMessageInfoData(KIO::Job *, const QString &)) ); + connect( mJob, TQT_SIGNAL(infoMessage(KIO::Job *, const TQString &)), + TQT_SLOT(slotCopyMessageInfoData(KIO::Job *, const TQString &)) ); } } else { @@ -231,7 +231,7 @@ ImapJob::~ImapJob() (*it).progressItem = 0; } if ( !(*it).msgList.isEmpty() ) { - for ( QPtrListIterator mit( (*it).msgList ); mit.current(); ++mit ) + for ( TQPtrListIterator mit( (*it).msgList ); mit.current(); ++mit ) mit.current()->setTransferInProgress( false ); } } @@ -255,7 +255,7 @@ ImapJob::~ImapJob() (*it).progressItem = 0; } if ( !(*it).msgList.isEmpty() ) { - for ( QPtrListIterator mit( (*it).msgList ); mit.current(); ++mit ) + for ( TQPtrListIterator mit( (*it).msgList ); mit.current(); ++mit ) mit.current()->setTransferInProgress( false ); } } @@ -283,7 +283,7 @@ void ImapJob::slotGetNextMessage() } KMAcctImap *account = msgParent->account(); KURL url = account->getUrl(); - QString path = msgParent->imapPath() + ";UID=" + QString::number(msg->UID()); + TQString path = msgParent->imapPath() + ";UID=" + TQString::number(msg->UID()); ImapAccountBase::jobData jd; jd.parent = 0; jd.offset = 0; jd.total = 1; jd.done = 0; @@ -314,11 +314,11 @@ void ImapJob::slotGetNextMessage() "ImapJobDownloading"+ProgressManager::getUniqueID(), i18n("Downloading message data"), i18n("Message with subject: ") + - QStyleSheet::escape( msg->subject() ), + TQStyleSheet::escape( msg->subject() ), true, account->useSSL() || account->useTLS() ); - connect ( jd.progressItem, SIGNAL( progressItemCanceled( KPIM::ProgressItem*)), - account, SLOT( slotAbortRequested( KPIM::ProgressItem* ) ) ); + connect ( jd.progressItem, TQT_SIGNAL( progressItemCanceled( KPIM::ProgressItem*)), + account, TQT_SLOT( slotAbortRequested( KPIM::ProgressItem* ) ) ); jd.progressItem->setTotalItems( jd.total ); KIO::SimpleJob *simpleJob = KIO::get( url, false, false ); @@ -327,18 +327,18 @@ void ImapJob::slotGetNextMessage() account->insertJob( mJob, jd ); if ( mPartSpecifier.find( "STRUCTURE", 0, false ) != -1 ) { - connect( mJob, SIGNAL(result(KIO::Job *)), - this, SLOT(slotGetBodyStructureResult(KIO::Job *)) ); + connect( mJob, TQT_SIGNAL(result(KIO::Job *)), + this, TQT_SLOT(slotGetBodyStructureResult(KIO::Job *)) ); } else { - connect( mJob, SIGNAL(result(KIO::Job *)), - this, SLOT(slotGetMessageResult(KIO::Job *)) ); + connect( mJob, TQT_SIGNAL(result(KIO::Job *)), + this, TQT_SLOT(slotGetMessageResult(KIO::Job *)) ); } - connect( mJob, SIGNAL(data(KIO::Job *, const QByteArray &)), - msgParent, SLOT(slotSimpleData(KIO::Job *, const QByteArray &)) ); + connect( mJob, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), + msgParent, TQT_SLOT(slotSimpleData(KIO::Job *, const TQByteArray &)) ); if ( jd.total > 1 ) { - connect(mJob, SIGNAL(processedSize(KIO::Job *, KIO::filesize_t)), - this, SLOT(slotProcessedSize(KIO::Job *, KIO::filesize_t))); + connect(mJob, TQT_SIGNAL(processedSize(KIO::Job *, KIO::filesize_t)), + this, TQT_SLOT(slotProcessedSize(KIO::Job *, KIO::filesize_t))); } } @@ -367,7 +367,7 @@ void ImapJob::slotGetMessageResult( KIO::Job * job ) bool gotData = true; if (job->error()) { - QString errorStr = i18n( "Error while retrieving messages from the server." ); + TQString errorStr = i18n( "Error while retrieving messages from the server." ); if ( (*it).progressItem ) (*it).progressItem->setStatus( errorStr ); account->handleJobError( job, errorStr ); @@ -485,7 +485,7 @@ void ImapJob::slotGetBodyStructureResult( KIO::Job * job ) } else { if ((*it).data.size() > 0) { - QDataStream stream( (*it).data, IO_ReadOnly ); + TQDataStream stream( (*it).data, IO_ReadOnly ); account->handleBodyStructure(stream, msg, mAttachmentStrategy); } } @@ -497,7 +497,7 @@ void ImapJob::slotGetBodyStructureResult( KIO::Job * job ) } //----------------------------------------------------------------------------- -void ImapJob::slotPutMessageDataReq( KIO::Job *job, QByteArray &data ) +void ImapJob::slotPutMessageDataReq( KIO::Job *job, TQByteArray &data ) { KMAcctImap *account = static_cast(mDestFolder->storage())->account(); if ( !account ) @@ -568,7 +568,7 @@ void ImapJob::slotPutMessageResult( KIO::Job *job ) } //----------------------------------------------------------------------------- -void ImapJob::slotCopyMessageInfoData(KIO::Job * job, const QString & data) +void ImapJob::slotCopyMessageInfoData(KIO::Job * job, const TQString & data) { KMFolderImap * imapFolder = static_cast(mDestFolder->storage()); KMAcctImap *account = imapFolder->account(); @@ -584,12 +584,12 @@ void ImapJob::slotCopyMessageInfoData(KIO::Job * job, const QString & data) if (data.find("UID") != -1) { // split - QString oldUid = data.section(' ', 1, 1); - QString newUid = data.section(' ', 2, 2); + TQString oldUid = data.section(' ', 1, 1); + TQString newUid = data.section(' ', 2, 2); // get lists of uids - QValueList olduids = KMFolderImap::splitSets(oldUid); - QValueList newuids = KMFolderImap::splitSets(newUid); + TQValueList olduids = KMFolderImap::splitSets(oldUid); + TQValueList newuids = KMFolderImap::splitSets(newUid); int index = -1; KMMessage * msg; @@ -607,7 +607,7 @@ void ImapJob::slotCopyMessageInfoData(KIO::Job * job, const QString & data) } //---------------------------------------------------------------------------- -void ImapJob::slotPutMessageInfoData(KIO::Job *job, const QString &data) +void ImapJob::slotPutMessageInfoData(KIO::Job *job, const TQString &data) { KMFolderImap * imapFolder = static_cast(mDestFolder->storage()); KMAcctImap *account = imapFolder->account(); @@ -647,7 +647,7 @@ void ImapJob::slotCopyMessageResult( KIO::Job *job ) if (job->error()) { mErrorCode = job->error(); - QString errStr = i18n("Error while copying messages."); + TQString errStr = i18n("Error while copying messages."); if ( (*it).progressItem ) (*it).progressItem->setStatus( errStr ); if ( account->handleJobError( job, errStr ) ) -- cgit v1.2.3