diff options
Diffstat (limited to 'kbugbuster/backend/mailsender.cpp')
-rw-r--r-- | kbugbuster/backend/mailsender.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/kbugbuster/backend/mailsender.cpp b/kbugbuster/backend/mailsender.cpp index ec32405d..59f73db2 100644 --- a/kbugbuster/backend/mailsender.cpp +++ b/kbugbuster/backend/mailsender.cpp @@ -5,7 +5,7 @@ #include <unistd.h> #include <stdio.h> -#include <qtimer.h> +#include <tqtimer.h> #include <klocale.h> #include <kstandarddirs.h> @@ -19,7 +19,7 @@ #include "mailsender.h" #include "smtp.h" -MailSender::MailSender(MailClient client,const QString &smtpServer) : +MailSender::MailSender(MailClient client,const TQString &smtpServer) : m_client( client ), m_smtpServer( smtpServer ) { } @@ -33,13 +33,13 @@ MailSender *MailSender::clone() const return new MailSender(m_client,m_smtpServer); } -bool MailSender::send(const QString &fromName,const QString &fromEmail,const QString &to, - const QString &subject,const QString &body,bool bcc, - const QString &recipient) +bool MailSender::send(const TQString &fromName,const TQString &fromEmail,const TQString &to, + const TQString &subject,const TQString &body,bool bcc, + const TQString &recipient) { - QString from( fromName ); + TQString from( fromName ); if ( !fromEmail.isEmpty() ) - from += QString::fromLatin1( " <%2>" ).arg( fromEmail ); + from += TQString::fromLatin1( " <%2>" ).arg( fromEmail ); kdDebug() << "MailSender::sendMail():\nFrom: " << from << "\nTo: " << to << "\nbccflag:" << bcc << "\nRecipient:" << recipient @@ -53,18 +53,18 @@ bool MailSender::send(const QString &fromName,const QString &fromEmail,const QSt bool needHeaders = true; - QString command = KStandardDirs::findExe(QString::fromLatin1("sendmail"), - QString::fromLatin1("/sbin:/usr/sbin:/usr/lib")); - if (!command.isNull()) command += QString::fromLatin1(" -oi -t"); + TQString command = KStandardDirs::findExe(TQString::fromLatin1("sendmail"), + TQString::fromLatin1("/sbin:/usr/sbin:/usr/lib")); + if (!command.isNull()) command += TQString::fromLatin1(" -oi -t"); else { - command = KStandardDirs::findExe(QString::fromLatin1("mail")); + command = KStandardDirs::findExe(TQString::fromLatin1("mail")); if (command.isNull()) return false; // give up - command.append(QString::fromLatin1(" -s ")); + command.append(TQString::fromLatin1(" -s ")); command.append(KProcess::quote(subject)); if (bcc) { - command.append(QString::fromLatin1(" -b ")); + command.append(TQString::fromLatin1(" -b ")); command.append(KProcess::quote(from)); } @@ -78,18 +78,18 @@ bool MailSender::send(const QString &fromName,const QString &fromEmail,const QSt if (!fd) { kdError() << "Unable to open a pipe to " << command << endl; - QTimer::singleShot( 0, this, SLOT( deleteLater() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( deleteLater() ) ); return false; } - QString textComplete; + TQString textComplete; if (needHeaders) { - textComplete += QString::fromLatin1("From: ") + from + '\n'; - textComplete += QString::fromLatin1("To: ") + to + '\n'; - if (bcc) textComplete += QString::fromLatin1("Bcc: ") + from + '\n'; - textComplete += QString::fromLatin1("Subject: ") + subject + '\n'; - textComplete += QString::fromLatin1("X-Mailer: KBugBuster") + '\n'; + textComplete += TQString::fromLatin1("From: ") + from + '\n'; + textComplete += TQString::fromLatin1("To: ") + to + '\n'; + if (bcc) textComplete += TQString::fromLatin1("Bcc: ") + from + '\n'; + textComplete += TQString::fromLatin1("Subject: ") + subject + '\n'; + textComplete += TQString::fromLatin1("X-Mailer: KBugBuster") + '\n'; } textComplete += '\n'; // end of headers textComplete += body; @@ -103,37 +103,37 @@ bool MailSender::send(const QString &fromName,const QString &fromEmail,const QSt if (!kapp->dcopClient()->isApplicationRegistered("kmail")) { KMessageBox::error(0,i18n("No running instance of KMail found.")); - QTimer::singleShot( 0, this, SLOT( deleteLater() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( deleteLater() ) ); return false; } emit status( i18n( "Passing mail to KDE email program..." ) ); if (!kMailOpenComposer(to,"", (bcc ? from : ""), subject,body,0,KURL())) { - QTimer::singleShot( 0, this, SLOT( deleteLater() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( deleteLater() ) ); return false; } } else if ( m_client == Direct ) { kdDebug() << "Sending Direct" << endl; - QStringList recipients; + TQStringList recipients; if ( !recipient.isEmpty() ) recipients << recipient; else recipients << to; - QString message = QString::fromLatin1( "From: " ) + from + - QString::fromLatin1( "\nTo: " ) + to + - QString::fromLatin1( "\nSubject: " ) + subject + - QString::fromLatin1( "\nX-Mailer: KBugBuster" ) + - QString::fromLatin1( "\n\n" ) + body; + TQString message = TQString::fromLatin1( "From: " ) + from + + TQString::fromLatin1( "\nTo: " ) + to + + TQString::fromLatin1( "\nSubject: " ) + subject + + TQString::fromLatin1( "\nX-Mailer: KBugBuster" ) + + TQString::fromLatin1( "\n\n" ) + body; Smtp *smtp = new Smtp( fromEmail, recipients, message, m_smtpServer ); - connect( smtp, SIGNAL( status( const QString & ) ), - this, SIGNAL( status( const QString & ) ) ); - connect( smtp, SIGNAL( success() ), - this, SLOT( smtpSuccess() ) ); - connect( smtp, SIGNAL( error( const QString &, const QString & ) ), - this, SLOT( smtpError( const QString &, const QString & ) ) ); + connect( smtp, TQT_SIGNAL( status( const TQString & ) ), + this, TQT_SIGNAL( status( const TQString & ) ) ); + connect( smtp, TQT_SIGNAL( success() ), + this, TQT_SLOT( smtpSuccess() ) ); + connect( smtp, TQT_SIGNAL( error( const TQString &, const TQString & ) ), + this, TQT_SLOT( smtpError( const TQString &, const TQString & ) ) ); smtp->insertChild( this ); // die when smtp dies } else { @@ -143,7 +143,7 @@ bool MailSender::send(const QString &fromName,const QString &fromEmail,const QSt if (m_client != Direct) { emit finished(); - QTimer::singleShot( 0, this, SLOT( deleteLater() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( deleteLater() ) ); } return true; @@ -158,13 +158,13 @@ void MailSender::smtpSuccess() emit finished(); } -void MailSender::smtpError(const QString &_command, const QString &_response) +void MailSender::smtpError(const TQString &_command, const TQString &_response) { if ( parent() != sender() || !parent()->inherits( "Smtp" ) ) return; - QString command = _command; - QString response = _response; + TQString command = _command; + TQString response = _response; Smtp *smtp = static_cast<Smtp *>( parent() ); smtp->removeChild( this ); @@ -176,18 +176,18 @@ void MailSender::smtpError(const QString &_command, const QString &_response) "response: %2" ).arg( command ).arg( response ) ); emit finished(); - QTimer::singleShot( 0, this, SLOT( deleteLater() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( deleteLater() ) ); } -int MailSender::kMailOpenComposer(const QString& arg0,const QString& arg1, - const QString& arg2,const QString& arg3,const QString& arg4,int arg5, +int MailSender::kMailOpenComposer(const TQString& arg0,const TQString& arg1, + const TQString& arg2,const TQString& arg3,const TQString& arg4,int arg5, const KURL& arg6) { int result = 0; - QByteArray data, replyData; - QCString replyType; - QDataStream arg( data, IO_WriteOnly ); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg( data, IO_WriteOnly ); arg << arg0; arg << arg1; arg << arg2; @@ -195,9 +195,9 @@ int MailSender::kMailOpenComposer(const QString& arg0,const QString& arg1, arg << arg4; arg << arg5; arg << arg6; - if (kapp->dcopClient()->call("kmail","KMailIface","openComposer(QString,QString,QString,QString,QString,int,KURL)", data, replyType, replyData ) ) { + if (kapp->dcopClient()->call("kmail","KMailIface","openComposer(TQString,TQString,TQString,TQString,TQString,int,KURL)", data, replyType, replyData ) ) { if ( replyType == "int" ) { - QDataStream _reply_stream( replyData, IO_ReadOnly ); + TQDataStream _reply_stream( replyData, IO_ReadOnly ); _reply_stream >> result; } else { kdDebug() << "kMailOpenComposer() call failed." << endl; |