diff options
Diffstat (limited to 'kbugbuster/backend/smtp.cpp')
-rw-r--r-- | kbugbuster/backend/smtp.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/kbugbuster/backend/smtp.cpp b/kbugbuster/backend/smtp.cpp index d54cafab..b297af20 100644 --- a/kbugbuster/backend/smtp.cpp +++ b/kbugbuster/backend/smtp.cpp @@ -9,26 +9,26 @@ #include "smtp.h" -#include <qtextstream.h> -#include <qsocket.h> -#include <qtimer.h> +#include <tqtextstream.h> +#include <tqsocket.h> +#include <tqtimer.h> #include <kapplication.h> #include <kmessagebox.h> #include <klocale.h> -Smtp::Smtp( const QString &from, const QStringList &to, - const QString &aMessage, - const QString &server, +Smtp::Smtp( const TQString &from, const TQStringList &to, + const TQString &aMessage, + const TQString &server, unsigned short int port ) { skipReadResponse = false; - mSocket = new QSocket( this ); - connect ( mSocket, SIGNAL( readyRead() ), - this, SLOT( readyRead() ) ); - connect ( mSocket, SIGNAL( connected() ), - this, SLOT( connected() ) ); - connect ( mSocket, SIGNAL( error(int) ), - this, SLOT( socketError(int) ) ); + mSocket = new TQSocket( this ); + connect ( mSocket, TQT_SIGNAL( readyRead() ), + this, TQT_SLOT( readyRead() ) ); + connect ( mSocket, TQT_SIGNAL( connected() ), + this, TQT_SLOT( connected() ) ); + connect ( mSocket, TQT_SIGNAL( error(int) ), + this, TQT_SLOT( socketError(int) ) ); message = aMessage; @@ -40,8 +40,8 @@ Smtp::Smtp( const QString &from, const QStringList &to, emit status( i18n( "Connecting to %1" ).arg( server ) ); mSocket->connectToHost( server, port ); - t = new QTextStream( mSocket ); - t->setEncoding(QTextStream::Latin1); + t = new TQTextStream( mSocket ); + t->setEncoding(TQTextStream::Latin1); } @@ -54,8 +54,8 @@ Smtp::~Smtp() } -void Smtp::send( const QString &from, const QStringList &to, - const QString &aMessage ) +void Smtp::send( const TQString &from, const TQStringList &to, + const TQString &aMessage ) { skipReadResponse = true; message = aMessage; @@ -86,19 +86,19 @@ void Smtp::socketError(int errorCode) { command = "CONNECT"; switch ( errorCode ) { - case QSocket::ErrConnectionRefused: + case TQSocket::ErrConnectionRefused: responseLine = i18n( "Connection refused." ); break; - case QSocket::ErrHostNotFound: + case TQSocket::ErrHostNotFound: responseLine = i18n( "Host Not Found." ); break; - case QSocket::ErrSocketRead: + case TQSocket::ErrSocketRead: responseLine = i18n( "Error reading socket." ); break; default: responseLine = i18n( "Internal error, unrecognized error." ); } - QTimer::singleShot( 0, this, SLOT(emitError()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(emitError()) ); } void Smtp::emitError() { @@ -141,13 +141,13 @@ void Smtp::readyRead() state = smtpBody; } else if ( state == smtpBody && responseLine[0] == '3' ) { command = "DATA"; - QString seperator = ""; + TQString seperator = ""; if (message[message.length() - 1] != '\n') seperator = "\r\n"; *t << message << seperator << ".\r\n"; state = smtpSuccess; } else if ( state == smtpSuccess && responseLine[0] == '2' ) { - QTimer::singleShot( 0, this, SIGNAL(success()) ); + TQTimer::singleShot( 0, this, TQT_SIGNAL(success()) ); } else if ( state == smtpQuit && responseLine[0] == '2' ) { command = "QUIT"; *t << "QUIT\r\n"; @@ -157,7 +157,7 @@ void Smtp::readyRead() } else if ( state == smtpClose ) { // we ignore it } else { // error occurred - QTimer::singleShot( 0, this, SLOT(emitError()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(emitError()) ); state = smtpClose; } @@ -168,7 +168,7 @@ void Smtp::readyRead() t = 0; delete mSocket; mSocket = 0; - QTimer::singleShot( 0, this, SLOT(deleteMe()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(deleteMe()) ); } } |