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/kmsender.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/kmsender.cpp')
-rw-r--r-- | kmail/kmsender.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/kmail/kmsender.cpp b/kmail/kmsender.cpp index fc2bfba1f..a79da268f 100644 --- a/kmail/kmsender.cpp +++ b/kmail/kmsender.cpp @@ -77,7 +77,7 @@ KMSender::~KMSender() } //----------------------------------------------------------------------------- -void KMSender::setStatusMsg(const QString &msg) +void KMSender::setStatusMsg(const TQString &msg) { if ( mProgressItem ) mProgressItem->setStatus(msg); @@ -86,7 +86,7 @@ void KMSender::setStatusMsg(const QString &msg) //----------------------------------------------------------------------------- void KMSender::readConfig(void) { - QString str; + TQString str; KConfigGroup config(KMKernel::config(), SENDER_GROUP); mSendImmediate = config.readBoolEntry("Immediate", true); @@ -118,8 +118,8 @@ bool KMSender::settingsOk() const } static void handleRedirections( KMMessage * m ) { - const QString from = m->headerField("X-KMail-Redirect-From"); - const QString msgId = m->msgId(); + const TQString from = m->headerField("X-KMail-Redirect-From"); + const TQString msgId = m->msgId(); if( from.isEmpty() || msgId.isEmpty() ) m->setMsgId( KMMessage::generateMessageId( m->sender() ) ); } @@ -208,7 +208,7 @@ void KMSender::outboxMsgAdded(int idx) //----------------------------------------------------------------------------- -bool KMSender::doSendQueued( const QString &customTransport ) +bool KMSender::doSendQueued( const TQString &customTransport ) { if (!settingsOk()) return false; @@ -231,8 +231,8 @@ bool KMSender::doSendQueued( const QString &customTransport ) for( int i = 0 ; i<mTotalMessages ; ++i ) mTotalBytes += mOutboxFolder->getMsgBase(i)->msgSize(); - connect( mOutboxFolder, SIGNAL(msgAdded(int)), - this, SLOT(outboxMsgAdded(int)) ); + connect( mOutboxFolder, TQT_SIGNAL(msgAdded(int)), + this, TQT_SLOT(outboxMsgAdded(int)) ); mCurrentMsg = 0; mSentFolder = kmkernel->sentFolder(); @@ -300,7 +300,7 @@ void KMSender::doSendMsg() KMMessage & newMsg( *mCurrentMsg->unencryptedMsg() ); mCurrentMsg->dwContentType() = newMsg.dwContentType(); mCurrentMsg->setContentTransferEncodingStr( newMsg.contentTransferEncodingStr() ); - QCString newDispo = newMsg.headerField("Content-Disposition").latin1(); + TQCString newDispo = newMsg.headerField("Content-Disposition").latin1(); if( newDispo.isEmpty() ) mCurrentMsg->removeHeaderField( "Content-Disposition" ); else @@ -471,18 +471,18 @@ void KMSender::doSendMsg() i18n( "Sending messages" ), i18n("Initiating sender process..."), true ); - connect( mProgressItem, SIGNAL(progressItemCanceled(KPIM::ProgressItem*)), - this, SLOT( slotAbortSend() ) ); + connect( mProgressItem, TQT_SIGNAL(progressItemCanceled(KPIM::ProgressItem*)), + this, TQT_SLOT( slotAbortSend() ) ); kapp->ref(); mSendInProgress = true; } - QString msgTransport = mCustomTransport; + TQString msgTransport = mCustomTransport; if ( msgTransport.isEmpty() ) { msgTransport = mCurrentMsg->headerField("X-KMail-Transport"); } if ( msgTransport.isEmpty() ) { - const QStringList sl = KMTransportInfo::availableTransports(); + const TQStringList sl = KMTransportInfo::availableTransports(); if (!sl.empty()) msgTransport = sl.front(); } @@ -516,8 +516,8 @@ void KMSender::doSendMsg() if (!mSendProc) sendProcStarted(false); else { - connect(mSendProc, SIGNAL(idle()), SLOT(slotIdle())); - connect(mSendProc, SIGNAL(started(bool)), SLOT(sendProcStarted(bool))); + connect(mSendProc, TQT_SIGNAL(idle()), TQT_SLOT(slotIdle())); + connect(mSendProc, TQT_SIGNAL(started(bool)), TQT_SLOT(sendProcStarted(bool))); // Run the precommand if there is one if ( !mTransportInfo->precommand.isEmpty() ) { @@ -534,11 +534,11 @@ void KMSender::doSendMsg() doSendMsgAux(); } -bool KMSender::runPrecommand( const QString & cmd ) { +bool KMSender::runPrecommand( const TQString & cmd ) { setStatusMsg( i18n("Executing precommand %1").arg( cmd ) ); mPrecommand = new KMPrecommand( cmd ); - connect( mPrecommand, SIGNAL(finished(bool)), - SLOT(slotPrecommandFinished(bool)) ); + connect( mPrecommand, TQT_SIGNAL(finished(bool)), + TQT_SLOT(slotPrecommandFinished(bool)) ); if ( !mPrecommand->start() ) { delete mPrecommand; mPrecommand = 0; return false; @@ -563,17 +563,17 @@ void KMSender::sendProcStarted(bool success) } -static QStringList addrSpecListToStringList( const AddrSpecList & l, bool allowEmpty=false ) { - QStringList result; +static TQStringList addrSpecListToStringList( const AddrSpecList & l, bool allowEmpty=false ) { + TQStringList result; for ( AddrSpecList::const_iterator it = l.begin(), end = l.end() ; it != end ; ++it ) { - const QString s = (*it).asString(); + const TQString s = (*it).asString(); if ( allowEmpty || !s.isEmpty() ) result.push_back( s ); } return result; } -static void extractSenderToCCAndBcc( KMMessage * aMsg, QString * sender, QStringList * to, QStringList * cc, QStringList * bcc ) { +static void extractSenderToCCAndBcc( KMMessage * aMsg, TQString * sender, TQStringList * to, TQStringList * cc, TQStringList * bcc ) { if ( sender ) *sender = aMsg->sender(); if( !aMsg->headerField("X-KMail-Recipients").isEmpty() ) { // extended BCC handling to prevent TOs and CCs from seeing @@ -597,15 +597,15 @@ void KMSender::doSendMsgAux() setStatusMsg(i18n("%3: subject of message","Sending message %1 of %2: %3") .arg(mSentMessages+mFailedMessages+1).arg(mTotalMessages) .arg(mCurrentMsg->subject())); - QStringList to, cc, bcc; - QString sender; + TQStringList to, cc, bcc; + TQString sender; extractSenderToCCAndBcc( mCurrentMsg, &sender, &to, &cc, &bcc ); // MDNs are required to have an empty envelope from as per RFC2298. if ( messageIsDispositionNotificationReport( mCurrentMsg ) && GlobalSettings::self()->sendMDNsWithEmptySender() ) sender = "<>"; - const QByteArray message = mCurrentMsg->asSendableString(); + const TQByteArray message = mCurrentMsg->asSendableString(); if ( sender.isEmpty() || !mSendProc->send( sender, to, cc, bcc, message ) ) { if ( mCurrentMsg ) mCurrentMsg->setTransferInProgress( false ); @@ -640,8 +640,8 @@ void KMSender::cleanup(void) mSentFolder = 0; } if ( mOutboxFolder ) { - disconnect( mOutboxFolder, SIGNAL(msgAdded(int)), - this, SLOT(outboxMsgAdded(int)) ); + disconnect( mOutboxFolder, TQT_SIGNAL(msgAdded(int)), + this, TQT_SLOT(outboxMsgAdded(int)) ); mOutboxFolder->close("dosendoutbox"); if ( mOutboxFolder->count( true ) == 0 ) { mOutboxFolder->expunge(); @@ -677,8 +677,8 @@ void KMSender::slotIdle() { assert(mSendProc != 0); - QString msg; - QString errString; + TQString msg; + TQString errString; if (mSendProc) errString = mSendProc->lastErrorMessage(); @@ -708,7 +708,7 @@ void KMSender::slotIdle() mCurrentMsg = 0; mFailedMessages++; // reset cached password - QMapIterator <QString,QString> pc; + TQMapIterator <TQString,TQString> pc; if ( (pc = mPasswdCache.find( mMethodStr )) != mPasswdCache.end() ) { mPasswdCache.erase(pc); } @@ -785,9 +785,9 @@ void KMSender::setSendQuotedPrintable(bool aSendQuotedPrintable) //----------------------------------------------------------------------------- -KMSendProc* KMSender::createSendProcFromString( const QString & transport ) +KMSendProc* KMSender::createSendProcFromString( const TQString & transport ) { - mTransportInfo->type = QString::null; + mTransportInfo->type = TQString::null; int nr = KMTransportInfo::findTransport(transport); if (nr) { @@ -798,7 +798,7 @@ KMSendProc* KMSender::createSendProcFromString( const QString & transport ) mTransportInfo->type = "smtp"; mTransportInfo->auth = false; mTransportInfo->encryption = "NONE"; - QString serverport = transport.mid(7); + TQString serverport = transport.mid(7); int colon = serverport.find(':'); if (colon != -1) { mTransportInfo->host = serverport.left(colon); @@ -813,7 +813,7 @@ KMSendProc* KMSender::createSendProcFromString( const QString & transport ) mTransportInfo->type = "smtps"; mTransportInfo->auth = false; mTransportInfo->encryption = "ssl"; - QString serverport = transport.mid(7); + TQString serverport = transport.mid(7); int colon = serverport.find(':'); if (colon != -1) { mTransportInfo->host = serverport.left(colon); @@ -877,7 +877,7 @@ void KMSender::setStatusByLink(const KMMessage *aMsg) //============================================================================= //============================================================================= KMSendProc::KMSendProc( KMSender * sender ) - : QObject( 0 ), + : TQObject( 0 ), mSender( sender ), mLastErrorMessage(), mSendOk( false ), @@ -890,11 +890,11 @@ void KMSendProc::reset() { mSending = false; mSendOk = false; - mLastErrorMessage = QString::null; + mLastErrorMessage = TQString::null; } //----------------------------------------------------------------------------- -void KMSendProc::failed(const QString &aMsg) +void KMSendProc::failed(const TQString &aMsg) { mSending = false; mSendOk = false; @@ -902,7 +902,7 @@ void KMSendProc::failed(const QString &aMsg) } //----------------------------------------------------------------------------- -void KMSendProc::statusMsg(const QString& aMsg) +void KMSendProc::statusMsg(const TQString& aMsg) { if (mSender) mSender->setStatusMsg(aMsg); } @@ -927,8 +927,8 @@ bool KMSendSendmail::doStart() { if (mSender->transportInfo()->host.isEmpty()) { - const QString str = i18n("Please specify a mailer program in the settings."); - const QString msg = i18n("Sending failed:\n%1\n" + const TQString str = i18n("Please specify a mailer program in the settings."); + const TQString msg = i18n("Sending failed:\n%1\n" "The message will stay in the 'outbox' folder and will be resent.\n" "Please remove it from there if you do not want the message to " "be resent.\n" @@ -943,12 +943,12 @@ bool KMSendSendmail::doStart() { { mMailerProc = new KProcess; assert(mMailerProc != 0); - connect(mMailerProc,SIGNAL(processExited(KProcess*)), - this, SLOT(sendmailExited(KProcess*))); - connect(mMailerProc,SIGNAL(wroteStdin(KProcess*)), - this, SLOT(wroteStdin(KProcess*))); - connect(mMailerProc,SIGNAL(receivedStderr(KProcess*,char*,int)), - this, SLOT(receivedStderr(KProcess*, char*, int))); + connect(mMailerProc,TQT_SIGNAL(processExited(KProcess*)), + this, TQT_SLOT(sendmailExited(KProcess*))); + connect(mMailerProc,TQT_SIGNAL(wroteStdin(KProcess*)), + this, TQT_SLOT(wroteStdin(KProcess*))); + connect(mMailerProc,TQT_SIGNAL(receivedStderr(KProcess*,char*,int)), + this, TQT_SLOT(receivedStderr(KProcess*, char*, int))); } return true; } @@ -967,7 +967,7 @@ void KMSendSendmail::abort() idle(); } -bool KMSendSendmail::doSend( const QString & sender, const QStringList & to, const QStringList & cc, const QStringList & bcc, const QByteArray & message ) { +bool KMSendSendmail::doSend( const TQString & sender, const TQStringList & to, const TQStringList & cc, const TQStringList & bcc, const TQByteArray & message ) { mMailerProc->clearArguments(); *mMailerProc << mSender->transportInfo()->host << "-i" << "-f" << sender @@ -1042,9 +1042,9 @@ KMSendSMTP::KMSendSMTP(KMSender *sender) mJob(0), mSlave(0) { - KIO::Scheduler::connect(SIGNAL(slaveError(KIO::Slave *, int, - const QString &)), this, SLOT(slaveError(KIO::Slave *, int, - const QString &))); + KIO::Scheduler::connect(TQT_SIGNAL(slaveError(KIO::Slave *, int, + const TQString &)), this, TQT_SLOT(slaveError(KIO::Slave *, int, + const TQString &))); } KMSendSMTP::~KMSendSMTP() @@ -1052,11 +1052,11 @@ KMSendSMTP::~KMSendSMTP() if (mJob) mJob->kill(); } -bool KMSendSMTP::doSend( const QString & sender, const QStringList & to, const QStringList & cc, const QStringList & bcc, const QByteArray & message ) { - QString query = "headers=0&from="; +bool KMSendSMTP::doSend( const TQString & sender, const TQStringList & to, const TQStringList & cc, const TQStringList & bcc, const TQByteArray & message ) { + TQString query = "headers=0&from="; query += KURL::encode_string( sender ); - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = to.begin(); it != to.end(); ++it ) query += "&to=" + KURL::encode_string(*it); @@ -1081,8 +1081,8 @@ bool KMSendSMTP::doSend( const QString & sender, const QStringList & to, const Q if (ti->auth) { - QMapIterator<QString,QString> tpc = mSender->mPasswdCache.find( ti->name ); - QString tpwd = ( tpc != mSender->mPasswdCache.end() )?(*tpc):QString::null; + TQMapIterator<TQString,TQString> tpc = mSender->mPasswdCache.find( ti->name ); + TQString tpwd = ( tpc != mSender->mPasswdCache.end() )?(*tpc):TQString::null; if ( ti->passwd().isEmpty() ) ti->setPasswd( tpwd ); @@ -1094,12 +1094,12 @@ bool KMSendSMTP::doSend( const QString & sender, const QStringList & to, const Q int result; KCursorSaver idle(KBusyPtr::idle()); - QString passwd = ti->passwd(); + TQString passwd = ti->passwd(); result = KIO::PasswordDialog::getNameAndPassword(ti->user, passwd, &b, i18n("You need to supply a username and a password to use this " - "SMTP server."), false, QString::null, ti->name, QString::null); + "SMTP server."), false, TQString::null, ti->name, TQString::null); - if ( result != QDialog::Accepted ) + if ( result != TQDialog::Accepted ) { abort(); return false; @@ -1138,7 +1138,7 @@ bool KMSendSMTP::doSend( const QString & sender, const QStringList & to, const Q if ( mMessageLength ) // allow +5% for subsequent LF->CRLF and dotstuffing (an average // over 2G-lines gives an average line length of 42-43): - query += "&size=" + QString::number( qRound( mMessageLength * 1.05 ) ); + query += "&size=" + TQString::number( qRound( mMessageLength * 1.05 ) ); destination.setPath("/send"); destination.setQuery( query ); @@ -1150,9 +1150,9 @@ bool KMSendSMTP::doSend( const QString & sender, const QStringList & to, const Q } mJob->addMetaData( "lf2crlf+dotstuff", "slave" ); KIO::Scheduler::assignJobToSlave(mSlave, mJob); - connect(mJob, SIGNAL(result(KIO::Job *)), this, SLOT(result(KIO::Job *))); - connect(mJob, SIGNAL(dataReq(KIO::Job *, QByteArray &)), - this, SLOT(dataReq(KIO::Job *, QByteArray &))); + connect(mJob, TQT_SIGNAL(result(KIO::Job *)), this, TQT_SLOT(result(KIO::Job *))); + connect(mJob, TQT_SIGNAL(dataReq(KIO::Job *, TQByteArray &)), + this, TQT_SLOT(dataReq(KIO::Job *, TQByteArray &))); mSendOk = true; mInProcess = true; return true; @@ -1184,7 +1184,7 @@ void KMSendSMTP::doFinish() { cleanup(); } -void KMSendSMTP::dataReq(KIO::Job *, QByteArray &array) +void KMSendSMTP::dataReq(KIO::Job *, TQByteArray &array) { // Send it by 32K chuncks const int chunkSize = QMIN( mMessageLength - mMessageOffset, 32*1024 ); @@ -1215,7 +1215,7 @@ void KMSendSMTP::result(KIO::Job *_job) } } -void KMSendSMTP::slaveError(KIO::Slave *aSlave, int error, const QString &errorMsg) +void KMSendSMTP::slaveError(KIO::Slave *aSlave, int error, const TQString &errorMsg) { if (aSlave == mSlave) { |