From c663b6440964f6ac48027143ac9e63298991f9d0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:33:34 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kioslave/smtp/interactivesmtpserver.h | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'kioslave/smtp/interactivesmtpserver.h') diff --git a/kioslave/smtp/interactivesmtpserver.h b/kioslave/smtp/interactivesmtpserver.h index 3ae210a74..39a07f6a9 100644 --- a/kioslave/smtp/interactivesmtpserver.h +++ b/kioslave/smtp/interactivesmtpserver.h @@ -34,20 +34,20 @@ your version. */ -#include +#include -static QString err2str( int err ) { +static TQString err2str( int err ) { switch ( err ) { - case QSocket::ErrConnectionRefused: return "Connection refused"; - case QSocket::ErrHostNotFound: return "Host not found"; - case QSocket::ErrSocketRead: return "Failed to read from socket"; + case TQSocket::ErrConnectionRefused: return "Connection refused"; + case TQSocket::ErrHostNotFound: return "Host not found"; + case TQSocket::ErrSocketRead: return "Failed to read from socket"; default: return "Unknown error"; } } -static QString escape( QString s ) { +static TQString escape( TQString s ) { return s .replace( '&', "&" ) .replace( '>', ">" ) @@ -57,7 +57,7 @@ static QString escape( QString s ) { } -static QString trim( const QString & s ) { +static TQString trim( const TQString & s ) { if ( s.endsWith( "\r\n" ) ) return s.left( s.length() - 2 ); if ( s.endsWith( "\r" ) || s.endsWith( "\n" ) ) @@ -66,21 +66,21 @@ static QString trim( const QString & s ) { } -class InteractiveSMTPServerWindow : public QWidget { +class InteractiveSMTPServerWindow : public TQWidget { Q_OBJECT public: - InteractiveSMTPServerWindow( QSocket * socket, QWidget * parent=0, const char * name=0, WFlags f=0 ); + InteractiveSMTPServerWindow( TQSocket * socket, TQWidget * parent=0, const char * name=0, WFlags f=0 ); ~InteractiveSMTPServerWindow(); public slots: void slotSendResponse(); - void slotDisplayClient( const QString & s ) { + void slotDisplayClient( const TQString & s ) { mTextEdit->append( "C:" + escape(s) ); } - void slotDisplayServer( const QString & s ) { + void slotDisplayServer( const TQString & s ) { mTextEdit->append( "S:" + escape(s) ); } - void slotDisplayMeta( const QString & s ) { + void slotDisplayMeta( const TQString & s ) { mTextEdit->append( "" + escape(s) + "" ); } void slotReadyRead() { @@ -88,7 +88,7 @@ public slots: slotDisplayClient( trim( mSocket->readLine() ) ); } void slotError( int err ) { - slotDisplayMeta( QString( "E: %1 (%2)" ).arg( err2str( err ) ).arg( err ) ); + slotDisplayMeta( TQString( "E: %1 (%2)" ).arg( err2str( err ) ).arg( err ) ); } void slotConnectionClosed() { slotDisplayMeta( "Connection closed by peer" ); @@ -97,20 +97,20 @@ public slots: mSocket->close(); } private: - QSocket * mSocket; - QTextEdit * mTextEdit; - QLineEdit * mLineEdit; + TQSocket * mSocket; + TQTextEdit * mTextEdit; + TQLineEdit * mLineEdit; }; -class InteractiveSMTPServer : public QServerSocket { +class InteractiveSMTPServer : public TQServerSocket { Q_OBJECT public: - InteractiveSMTPServer( QObject * parent=0 ); + InteractiveSMTPServer( TQObject * parent=0 ); ~InteractiveSMTPServer() {} /*! \reimp */ void newConnection( int fd ) { - QSocket * socket = new QSocket(); + TQSocket * socket = new TQSocket(); socket->setSocket( fd ); InteractiveSMTPServerWindow * w = new InteractiveSMTPServerWindow( socket ); w->show(); -- cgit v1.2.1