diff options
Diffstat (limited to 'kmail/imapjob.cpp')
-rw-r--r-- | kmail/imapjob.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/kmail/imapjob.cpp b/kmail/imapjob.cpp index b76c6d2cc..fe773a9dc 100644 --- a/kmail/imapjob.cpp +++ b/kmail/imapjob.cpp @@ -19,11 +19,11 @@ * * In addition, as a special exception, the copyright holders give * permission to link the code of this program with any edition of - * the Qt library by Trolltech AS, Norway (or with modified versions - * of Qt that use the same license as Qt), and distribute linked + * the TQt library by Trolltech AS, Norway (or with modified versions + * of TQt that use the same license as TQt), and distribute linked * combinations including the two. You must obey the GNU General * Public License in all respects for all of the code used other than - * Qt. If you modify this file, you may extend this exception to + * TQt. If you modify this file, you may extend this exception to * your version of the file, but you are not obligated to do so. If * you do not wish to do so, delete this exception statement from * your version. @@ -86,11 +86,11 @@ void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder, if (folder) { folder->open("imapjobdest"); } - KMFolder *msg_parent = msg->parent(); - if (msg_parent) { - msg_parent->open("imapjobsrc"); + KMFolder *msg_tqparent = msg->tqparent(); + if (msg_tqparent) { + msg_tqparent->open("imapjobsrc"); } - mSrcFolder = msg_parent; + mSrcFolder = msg_tqparent; // If there is a destination folder, this is a copy, move or put to an // imap folder, use its account for keeping track of the job. Otherwise, // this is a get job and the src folder is an imap one. Use its account @@ -99,8 +99,8 @@ void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder, if (folder) { account = folder->account(); } else { - if ( msg_parent && msg_parent->storage() ) - account = static_cast<KMFolderImap*>(msg_parent->storage())->account(); + if ( msg_tqparent && msg_tqparent->storage() ) + account = static_cast<KMFolderImap*>(msg_tqparent->storage())->account(); } if ( !account || account->makeConnection() == ImapAccountBase::Error ) { @@ -118,21 +118,21 @@ void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder, ++it; if ( mSrcFolder && !curMsg->isMessage() ) { - int idx = mSrcFolder->find( curMsg ); + int idx = mSrcFolder->tqfind( curMsg ); curMsg = mSrcFolder->getMsg( idx ); } KURL url = account->getUrl(); 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.tqparent = 0; jd.offset = 0; jd.done = 0; jd.total = ( curMsg->msgSizeServer() > 0 ) ? curMsg->msgSizeServer() : curMsg->msgSize(); jd.msgList.append( curMsg ); 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); + int a = cstr.tqfind("\nX-UID: "); + int b = cstr.tqfind('\n', a); + if (a != -1 && b != -1 && cstr.tqfind("\n\n") > a) cstr.remove(a, b-a); jd.data.resize( cstr.length() + cstr.tqcontains( "\n" ) - cstr.tqcontains( "\r\n" ) ); unsigned int i = 0; char prevChar = '\0'; @@ -175,10 +175,10 @@ void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder, KURL url = account->getUrl(); KURL destUrl = account->getUrl(); destUrl.setPath(folder->imapPath()); - KMFolderImap *imapDestFolder = static_cast<KMFolderImap*>(msg_parent->storage()); + KMFolderImap *imapDestFolder = static_cast<KMFolderImap*>(msg_tqparent->storage()); url.setPath( imapDestFolder->imapPath() + ";UID=" + sets ); ImapAccountBase::jobData jd; - jd.parent = 0; jd.offset = 0; + jd.tqparent = 0; jd.offset = 0; jd.total = 1; jd.done = 0; jd.msgList = msgList; @@ -191,7 +191,7 @@ void ImapJob::init( JobType jt, TQString sets, KMFolderImap* folder, "ImapJobCopyMove"+ProgressManager::getUniqueID(), i18n("Server operation"), i18n("Source folder: %1 - Destination folder: %2") - .arg( TQStyleSheet::escape( msg_parent->prettyURL() ), + .arg( TQStyleSheet::escape( msg_tqparent->prettyURL() ), TQStyleSheet::escape( mDestFolder->prettyURL() ) ), true, account->useSSL() || account->useTLS() ); @@ -285,12 +285,12 @@ void ImapJob::slotGetNextMessage() KURL url = account->getUrl(); TQString path = msgParent->imapPath() + ";UID=" + TQString::number(msg->UID()); ImapAccountBase::jobData jd; - jd.parent = 0; jd.offset = 0; + jd.tqparent = 0; jd.offset = 0; jd.total = 1; jd.done = 0; jd.msgList.append( msg ); if ( !mPartSpecifier.isEmpty() ) { - if ( mPartSpecifier.find ("STRUCTURE", 0, false) != -1 ) { + if ( mPartSpecifier.tqfind ("STRUCTURE", 0, false) != -1 ) { path += ";SECTION=STRUCTURE"; } else if ( mPartSpecifier == "HEADER" ) { path += ";SECTION=HEADER"; @@ -325,7 +325,7 @@ void ImapJob::slotGetNextMessage() KIO::Scheduler::assignJobToSlave( account->slave(), simpleJob ); mJob = simpleJob; account->insertJob( mJob, jd ); - if ( mPartSpecifier.find( "STRUCTURE", 0, false ) != -1 ) + if ( mPartSpecifier.tqfind( "STRUCTURE", 0, false ) != -1 ) { connect( mJob, TQT_SIGNAL(result(KIO::Job *)), this, TQT_SLOT(slotGetBodyStructureResult(KIO::Job *)) ); @@ -347,15 +347,15 @@ void ImapJob::slotGetNextMessage() void ImapJob::slotGetMessageResult( KIO::Job * job ) { KMMessage *msg = mMsgList.first(); - if (!msg || !msg->parent() || !job) { + if (!msg || !msg->tqparent() || !job) { emit messageRetrieved( 0 ); deleteLater(); return; } - KMFolderImap* parent = static_cast<KMFolderImap*>(msg->storage()); + KMFolderImap* tqparent = static_cast<KMFolderImap*>(msg->storage()); if (msg->transferInProgress()) msg->setTransferInProgress( false ); - KMAcctImap *account = parent->account(); + KMAcctImap *account = tqparent->account(); if ( !account ) { emit messageRetrieved( 0 ); deleteLater(); @@ -369,7 +369,7 @@ void ImapJob::slotGetMessageResult( KIO::Job * job ) { TQString errorStr = i18n( "Error while retrieving messages from the server." ); if ( (*it).progressItem ) - (*it).progressItem->seStatus( errorStr ); + (*it).progressItem->setqStatus( errorStr ); account->handleJobError( job, errorStr ); return; } else { @@ -397,10 +397,10 @@ void ImapJob::slotGetMessageResult( KIO::Job * job ) // During the construction of the message from the byteArray it does // not have a uid. Therefore we have to make sure that no connected // slots are called, since they would operate on uid == 0. - msg->parent()->storage()->blockSignals( true ); + msg->tqparent()->storage()->blockSignals( true ); msg->fromByteArray( (*it).data ); // now let others react - msg->parent()->storage()->blockSignals( false ); + msg->tqparent()->storage()->blockSignals( false ); if ( size > 0 && msg->msgSizeServer() == 0 ) { msg->setMsgSizeServer(size); } @@ -447,9 +447,9 @@ void ImapJob::slotGetMessageResult( KIO::Job * job ) /* we got an answer but not data * this means that the msg is not on the server anymore so delete it */ emit messageRetrieved( 0 ); - parent->ignoreJobsForMessage( msg ); - int idx = parent->find( msg ); - if (idx != -1) parent->removeMsg( idx, true ); + tqparent->ignoreJobsForMessage( msg ); + int idx = tqparent->tqfind( msg ); + if (idx != -1) tqparent->removeMsg( idx, true ); // the removeMsg will unGet the message, which will delete all // jobs, including this one return; @@ -464,14 +464,14 @@ void ImapJob::slotGetMessageResult( KIO::Job * job ) void ImapJob::slotGetBodyStructureResult( KIO::Job * job ) { KMMessage *msg = mMsgList.first(); - if (!msg || !msg->parent() || !job) { + if (!msg || !msg->tqparent() || !job) { deleteLater(); return; } - KMFolderImap* parent = static_cast<KMFolderImap*>(msg->storage()); + KMFolderImap* tqparent = static_cast<KMFolderImap*>(msg->storage()); if (msg->transferInProgress()) msg->setTransferInProgress( false ); - KMAcctImap *account = parent->account(); + KMAcctImap *account = tqparent->account(); if ( !account ) { deleteLater(); return; @@ -540,12 +540,12 @@ void ImapJob::slotPutMessageResult( KIO::Job *job ) if (job->error()) { if ( (*it).progressItem ) - (*it).progressItem->seStatus( i18n("Uploading message data failed.") ); + (*it).progressItem->setqStatus( i18n("Uploading message data failed.") ); account->handlePutError( job, *it, mDestFolder ); return; } else { if ( (*it).progressItem ) - (*it).progressItem->seStatus( i18n("Uploading message data completed.") ); + (*it).progressItem->setqStatus( i18n("Uploading message data completed.") ); if ( mParentProgressItem ) { mParentProgressItem->incCompletedItems(); @@ -583,7 +583,7 @@ void ImapJob::slotCopyMessageInfoData(KIO::Job * job, const TQString & data) ImapAccountBase::JobIterator it = account->findJob( job ); if ( it == account->jobsEnd() ) return; - if (data.find("UID") != -1) + if (data.tqfind("UID") != -1) { // split TQString oldUid = data.section(' ', 1, 1); @@ -622,7 +622,7 @@ void ImapJob::slotPutMessageInfoData(KIO::Job *job, const TQString &data) ImapAccountBase::JobIterator it = account->findJob( job ); if ( it == account->jobsEnd() ) return; - if ( data.find("UID") != -1 ) + if ( data.tqfind("UID") != -1 ) { ulong uid = ( data.right(data.length()-4) ).toInt(); if ( !(*it).msgList.isEmpty() ) @@ -651,7 +651,7 @@ void ImapJob::slotCopyMessageResult( KIO::Job *job ) mErrorCode = job->error(); TQString errStr = i18n("Error while copying messages."); if ( (*it).progressItem ) - (*it).progressItem->seStatus( errStr ); + (*it).progressItem->setqStatus( errStr ); if ( account->handleJobError( job, errStr ) ) deleteLater(); return; @@ -678,9 +678,9 @@ void ImapJob::execute() } //----------------------------------------------------------------------------- -void ImapJob::setParentFolder( const KMFolderImap* parent ) +void ImapJob::setParentFolder( const KMFolderImap* tqparent ) { - mParentFolder = const_cast<KMFolderImap*>( parent ); + mParentFolder = const_cast<KMFolderImap*>( tqparent ); } //----------------------------------------------------------------------------- @@ -690,13 +690,13 @@ void ImapJob::slotProcessedSize(KIO::Job * job, KIO::filesize_t processed) if (!msg || !job) { return; } - KMFolderImap* parent = 0; - if ( msg->parent() && msg->parent()->folderType() == KMFolderTypeImap ) - parent = static_cast<KMFolderImap*>(msg->parent()->storage()); + KMFolderImap* tqparent = 0; + if ( msg->tqparent() && msg->tqparent()->folderType() == KMFolderTypeImap ) + tqparent = static_cast<KMFolderImap*>(msg->tqparent()->storage()); else if (mDestFolder) // put - parent = static_cast<KMFolderImap*>(mDestFolder->storage()); - if (!parent) return; - KMAcctImap *account = parent->account(); + tqparent = static_cast<KMFolderImap*>(mDestFolder->storage()); + if (!tqparent) return; + KMAcctImap *account = tqparent->account(); if ( !account ) return; ImapAccountBase::JobIterator it = account->findJob( job ); if ( it == account->jobsEnd() ) return; |