summaryrefslogtreecommitdiffstats
path: root/src/UiGuiIndentServer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/UiGuiIndentServer.cpp')
-rwxr-xr-xsrc/UiGuiIndentServer.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/UiGuiIndentServer.cpp b/src/UiGuiIndentServer.cpp
index 8a93094..ad0dd3e 100755
--- a/src/UiGuiIndentServer.cpp
+++ b/src/UiGuiIndentServer.cpp
@@ -21,7 +21,7 @@
#include <tqtcpserver.h>
#include <tqtcpsocket.h>
-#include <tqmessagebox.h>
+#include <tntqmessagebox.h>
#include <tqtdebug.h>
//! \defgroup grp_Server All concerning the server component.
@@ -43,7 +43,7 @@
matter for which application the plugin/client is developed.
*/
-UiGuiIndentServer::UiGuiIndentServer(void) : QObject() {
+UiGuiIndentServer::UiGuiIndentServer(void) : TQObject() {
_tcpServer = NULL;
_currentClientConnection = NULL;
_readyForHandleRequest = false;
@@ -56,12 +56,12 @@ UiGuiIndentServer::~UiGuiIndentServer(void) {
void UiGuiIndentServer::startServer() {
if ( _tcpServer == NULL ) {
- _tcpServer = new QTcpServer(this);
+ _tcpServer = new TQTcpServer(this);
}
if ( !_tcpServer->isListening() ) {
- if ( !_tcpServer->listen(QHostAddress::Any, quint16(84484)) ) {
- QMessageBox::critical( NULL, tr("UiGUI Server"), tr("Unable to start the server: %1.").arg(_tcpServer->errorString()) );
+ if ( !_tcpServer->listen(TQHostAddress::Any, tquint16(84484)) ) {
+ TQMessageBox::critical( NULL, tr("UiGUI Server"), tr("Unable to start the server: %1.").arg(_tcpServer->errorString()) );
return;
}
}
@@ -84,7 +84,7 @@ void UiGuiIndentServer::stopServer() {
void UiGuiIndentServer::handleNewConnection() {
- QTcpSocket *clientConnection = _tcpServer->nextPendingConnection();
+ TQTcpSocket *clientConnection = _tcpServer->nextPendingConnection();
connect( clientConnection, SIGNAL(disconnected()), clientConnection, SLOT(deleteLater()) );
connect( clientConnection, SIGNAL(readyRead()), this, SLOT(handleReceivedData()) );
@@ -96,15 +96,15 @@ void UiGuiIndentServer::handleReceivedData() {
return;
}
- _currentClientConnection = qobject_cast<QTcpSocket*>( sender() );
- QString receivedData = "";
+ _currentClientConnection = qobject_cast<TQTcpSocket*>( sender() );
+ TQString receivedData = "";
if ( _currentClientConnection != NULL ) {
- QDataStream in(_currentClientConnection);
- in.setVersion(QDataStream::Qt_4_0);
+ TQDataStream in(_currentClientConnection);
+ in.setVersion(TQDataStream::TQt_4_0);
if ( _blockSize == 0 ) {
- if ( _currentClientConnection->bytesAvailable() < (int)sizeof(quint32) )
+ if ( _currentClientConnection->bytesAvailable() < (int)sizeof(tquint32) )
return;
in >> _blockSize;
@@ -113,12 +113,12 @@ void UiGuiIndentServer::handleReceivedData() {
if ( _currentClientConnection->bytesAvailable() < _blockSize )
return;
- QString receivedMessage;
+ TQString receivedMessage;
in >> receivedMessage;
_blockSize = 0;
- qDebug() << "receivedMessage: " << receivedMessage;
+ tqDebug() << "receivedMessage: " << receivedMessage;
if ( receivedMessage == "ts" ) {
sendMessage("Toll");
@@ -130,16 +130,16 @@ void UiGuiIndentServer::handleReceivedData() {
}
-void UiGuiIndentServer::sendMessage( const QString &message ) {
+void UiGuiIndentServer::sendMessage( const TQString &message ) {
_readyForHandleRequest = false;
_dataToSend = "";
- QDataStream out(&_dataToSend, QIODevice::WriteOnly);
- out.setVersion(QDataStream::Qt_4_0);
- out << (quint32)0;
+ TQDataStream out(&_dataToSend, TQIODevice::WriteOnly);
+ out.setVersion(TQDataStream::TQt_4_0);
+ out << (tquint32)0;
out << message;
out.device()->seek(0);
- out << (quint32)(_dataToSend.size() - sizeof(quint32));
+ out << (tquint32)(_dataToSend.size() - sizeof(tquint32));
connect(_currentClientConnection, SIGNAL(bytesWritten(qint64)), this, SLOT(checkIfReadyForHandleRequest()));
_currentClientConnection->write(_dataToSend);
@@ -148,8 +148,8 @@ void UiGuiIndentServer::sendMessage( const QString &message ) {
void UiGuiIndentServer::checkIfReadyForHandleRequest() {
if ( _currentClientConnection->bytesToWrite() == 0 ) {
- QString dataToSendStr = _dataToSend.right( _dataToSend.size() - sizeof(quint32) );
- qDebug() << "checkIfReadyForHandleRequest _dataToSend was: " << dataToSendStr;
+ TQString dataToSendStr = _dataToSend.right( _dataToSend.size() - sizeof(tquint32) );
+ tqDebug() << "checkIfReadyForHandleRequest _dataToSend was: " << dataToSendStr;
disconnect(_currentClientConnection, SIGNAL(bytesWritten(qint64)), this, SLOT(checkIfReadyForHandleRequest()));
_readyForHandleRequest = true;
}