diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kmail/imapjob.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/imapjob.cpp')
-rw-r--r-- | kmail/imapjob.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/kmail/imapjob.cpp b/kmail/imapjob.cpp index 13d4baa84..50db423cb 100644 --- a/kmail/imapjob.cpp +++ b/kmail/imapjob.cpp @@ -41,7 +41,7 @@ using KPIM::ProgressManager; #include "util.h" -#include <qstylesheet.h> +#include <tqstylesheet.h> #include <kio/scheduler.h> #include <kdebug.h> #include <klocale.h> @@ -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<KMMessage>& msgList, QString sets, JobType jt, +ImapJob::ImapJob( TQPtrList<KMMessage>& 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<KMMessage>& msgList ) +void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder, + TQPtrList<KMMessage>& 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<KMMessage> it( msgList ); + TQPtrListIterator<KMMessage> 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<KMMessage> mit( (*it).msgList ); mit.current(); ++mit ) + for ( TQPtrListIterator<KMMessage> 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<KMMessage> mit( (*it).msgList ); mit.current(); ++mit ) + for ( TQPtrListIterator<KMMessage> 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<KMFolderImap*>(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<KMFolderImap*>(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<ulong> olduids = KMFolderImap::splitSets(oldUid); - QValueList<ulong> newuids = KMFolderImap::splitSets(newUid); + TQValueList<ulong> olduids = KMFolderImap::splitSets(oldUid); + TQValueList<ulong> 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<KMFolderImap*>(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 ) ) |