summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/msn/transport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/protocols/msn/transport.cpp')
-rw-r--r--kopete/protocols/msn/transport.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/kopete/protocols/msn/transport.cpp b/kopete/protocols/msn/transport.cpp
index 492117b6..904e9411 100644
--- a/kopete/protocols/msn/transport.cpp
+++ b/kopete/protocols/msn/transport.cpp
@@ -34,8 +34,8 @@ using namespace KNetwork;
namespace PeerToPeer {
-Transport::Transport(QObject* parent, const char* name)
- : QObject(parent, name)
+Transport::Transport(TQObject* parent, const char* name)
+ : TQObject(parent, name)
{
mFormatter = new PeerToPeer::MessageFormatter(this);
}
@@ -47,7 +47,7 @@ Transport::~Transport()
//BEGIN Public Methods
-TransportBridge* Transport::getBridge (const QString& to, Q_UINT16 port, TransportBridgeType type, const QString& identifier)
+TransportBridge* Transport::getBridge (const TQString& to, Q_UINT16 port, TransportBridgeType type, const TQString& identifier)
{
TransportBridge *bridge = 0l;
KInetSocketAddress address;
@@ -72,7 +72,7 @@ TransportBridge* Transport::getBridge (const QString& to, Q_UINT16 port, Transpo
if (bridge != 0l)
{
- QObject::connect(bridge, SIGNAL(readyRead(const QByteArray&)), SLOT(slotOnReceive(const QByteArray&)));
+ TQObject::connect(bridge, TQT_SIGNAL(readyRead(const TQByteArray&)), TQT_SLOT(slotOnReceive(const TQByteArray&)));
}
return 0l;
@@ -81,7 +81,7 @@ TransportBridge* Transport::getBridge (const QString& to, Q_UINT16 port, Transpo
void Transport::setDefaultBridge(MSNSwitchBoardSocket* mss)
{
mDefaultBridge = mss;
- QObject::connect((MSNSwitchBoardSocket*)mDefaultBridge, SIGNAL(messageReceived(const QString&, const QByteArray&)), SLOT(slotOnReceive(const QString&, const QByteArray&)));
+ TQObject::connect((MSNSwitchBoardSocket*)mDefaultBridge, TQT_SIGNAL(messageReceived(const TQString&, const TQByteArray&)), TQT_SLOT(slotOnReceive(const TQString&, const TQByteArray&)));
}
//END
@@ -92,7 +92,7 @@ void Transport::setDefaultBridge(MSNSwitchBoardSocket* mss)
// {
// }
-void Transport::slotOnReceive(const QString& contact, const QByteArray& bytes)
+void Transport::slotOnReceive(const TQString& contact, const TQByteArray& bytes)
{
kdDebug (14140) << k_funcinfo << " >> RECEIVED " << bytes.size() << " bytes." << endl;
// Message message = mFormatter->readMessage(bytes);
@@ -103,15 +103,15 @@ void Transport::slotOnReceive(const QString& contact, const QByteArray& bytes)
-TransportBridge::TransportBridge(const KNetwork::KInetSocketAddress& to, MessageFormatter* formatter, QObject* parent, const char* name)
-: QObject(parent, name)
+TransportBridge::TransportBridge(const KNetwork::KInetSocketAddress& to, MessageFormatter* formatter, TQObject* parent, const char* name)
+: TQObject(parent, name)
{
mAddress = to;
mFormatter = formatter;
}
-TransportBridge::TransportBridge(KNetwork::KClientSocketBase* socket, MessageFormatter* formatter, QObject* parent, const char* name)
-: QObject(parent, name)
+TransportBridge::TransportBridge(KNetwork::KClientSocketBase* socket, MessageFormatter* formatter, TQObject* parent, const char* name)
+: TQObject(parent, name)
{
mSocket = socket;
mAddress = mSocket->peerAddress();
@@ -166,17 +166,17 @@ void TransportBridge::slotOnSocketReceive()
-TcpTransportBridge::TcpTransportBridge(const KNetwork::KInetSocketAddress& to, MessageFormatter* formatter, QObject* parent, const char* name)
+TcpTransportBridge::TcpTransportBridge(const KNetwork::KInetSocketAddress& to, MessageFormatter* formatter, TQObject* parent, const char* name)
: TransportBridge(to, formatter, parent, name)
{
- mSocket = new KStreamSocket(mAddress.ipAddress().toString(), QString::number(mAddress.port()), this);
+ mSocket = new KStreamSocket(mAddress.ipAddress().toString(), TQString::number(mAddress.port()), this);
mSocket->setBlocking(false);
- QObject::connect(mSocket, SIGNAL(connected(const KResolverEntry&)), SLOT(slotOnSocketConnect()));
- QObject::connect(mSocket, SIGNAL(gotError(int)), SLOT(slotOnError(int)));
+ TQObject::connect(mSocket, TQT_SIGNAL(connected(const KResolverEntry&)), TQT_SLOT(slotOnSocketConnect()));
+ TQObject::connect(mSocket, TQT_SIGNAL(gotError(int)), TQT_SLOT(slotOnError(int)));
mConnected = false;
}
-TcpTransportBridge::TcpTransportBridge(KNetwork::KClientSocketBase* socket, MessageFormatter* formatter, QObject* parent, const char* name)
+TcpTransportBridge::TcpTransportBridge(KNetwork::KClientSocketBase* socket, MessageFormatter* formatter, TQObject* parent, const char* name)
: TransportBridge(socket, formatter, parent, name)
{
mConnected = (mSocket->state() == KStreamSocket::Open) ? true : false;
@@ -199,7 +199,7 @@ void TcpTransportBridge::slotOnConnect()
KStreamSocket *socket = static_cast<KStreamSocket*>(mSocket);
socket->setTimeout(5000);
- QObject::connect(socket, SIGNAL(timeOut()), SLOT(slotOnSocketConnectTimeout()));
+ TQObject::connect(socket, TQT_SIGNAL(timeOut()), TQT_SLOT(slotOnSocketConnectTimeout()));
mSocket->connect();
}
@@ -213,7 +213,7 @@ void TcpTransportBridge::slotOnDisconnect()
void TcpTransportBridge::slotOnError(int errorCode)
{
kdDebug(14140) << k_funcinfo << "Bridge (" << name() << ") ERROR occurred on {" << mSocket->localAddress().toString() << " <-> " << mSocket->peerAddress().toString() << "} - " << mSocket->errorString() << endl;
- emit bridgeError(QString("Bridge ERROR %1: %2").arg(errorCode).arg(mSocket->errorString()));
+ emit bridgeError(TQString("Bridge ERROR %1: %2").arg(errorCode).arg(mSocket->errorString()));
if (mConnected){
mSocket->disconnect();
mConnected = false;
@@ -239,13 +239,13 @@ void TcpTransportBridge::slotOnSocketConnect()
<< mSocket->localAddress().toString() << endl;
mConnected = true;
- QObject::connect(mSocket, SIGNAL(readyRead()), SLOT(slotOnSocketReceive()));
- QObject::connect(mSocket, SIGNAL(closed()), SLOT(slotOnSocketClose()));
+ TQObject::connect(mSocket, TQT_SIGNAL(readyRead()), TQT_SLOT(slotOnSocketReceive()));
+ TQObject::connect(mSocket, TQT_SIGNAL(closed()), TQT_SLOT(slotOnSocketClose()));
mVerified = true;
- QString foo = "foo\0";
+ TQString foo = "foo\0";
mSocket->writeBlock(foo.ascii(), foo.length());
- foo = QString::null;
+ foo = TQString::null;
emit bridgeConnect();
}
@@ -254,15 +254,15 @@ void TcpTransportBridge::slotOnSocketReceive()
{
kdDebug (14140) << k_funcinfo << "Bridge (" << name() << ") RECEIVED " << mSocket->bytesAvailable() << " bytes." << endl;
- QByteArray bytes(mSocket->bytesAvailable());
+ TQByteArray bytes(mSocket->bytesAvailable());
mSocket->readBlock(bytes.data(), bytes.size());
// Write the data to the buffer.
mBuffer.write(bytes);
if (mVerified == false && mBuffer.size() >= 4)
{
- QByteArray foo = mBuffer.read(4);
- if (QString(foo) == "foo"){
+ TQByteArray foo = mBuffer.read(4);
+ if (TQString(foo) == "foo"){
kdDebug (14140) << k_funcinfo << "Bridge (" << name() << ") CONNECTION verified." << endl;
mVerified = true;
}
@@ -272,7 +272,7 @@ void TcpTransportBridge::slotOnSocketReceive()
{
if (mBuffer.size() >= 4 && mLength == 0)
{
- QByteArray array = mBuffer.read(4);
+ TQByteArray array = mBuffer.read(4);
for (int i=0; i < 4; i++){
((char*)mLength)[i] = array[i];
}
@@ -312,7 +312,7 @@ void TcpTransportBridge::slotOnSocketConnectTimeout()
TcpTransportBridge::Buffer::Buffer(Q_UINT32 length)
-: QByteArray(length)
+: TQByteArray(length)
{
}
@@ -322,7 +322,7 @@ TcpTransportBridge::Buffer::~Buffer()
//BEGIN Public Methods
-void TcpTransportBridge::Buffer::write(const QByteArray& bytes)
+void TcpTransportBridge::Buffer::write(const TQByteArray& bytes)
{
resize(size() + bytes.size());
for (uint i=0; i < bytes.size(); i++){
@@ -330,11 +330,11 @@ void TcpTransportBridge::Buffer::write(const QByteArray& bytes)
}
}
-QByteArray TcpTransportBridge::Buffer::read(Q_UINT32 length)
+TQByteArray TcpTransportBridge::Buffer::read(Q_UINT32 length)
{
- if (length >= size()) return QByteArray();
+ if (length >= size()) return TQByteArray();
- QByteArray buffer;
+ TQByteArray buffer;
buffer.duplicate(data(), length);
char *bytes = new char[size() - length];