diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/protocols/msn/incomingtransfer.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/msn/incomingtransfer.cpp')
-rw-r--r-- | kopete/protocols/msn/incomingtransfer.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/kopete/protocols/msn/incomingtransfer.cpp b/kopete/protocols/msn/incomingtransfer.cpp index aefbdbfe..c7757219 100644 --- a/kopete/protocols/msn/incomingtransfer.cpp +++ b/kopete/protocols/msn/incomingtransfer.cpp @@ -29,13 +29,13 @@ using P2P::Message; using namespace KNetwork; // Qt includes -#include <qfile.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqregexp.h> // Kopete includes #include <kopetetransfermanager.h> -IncomingTransfer::IncomingTransfer(const QString& from, P2P::Dispatcher *dispatcher, Q_UINT32 sessionId) +IncomingTransfer::IncomingTransfer(const TQString& from, P2P::Dispatcher *dispatcher, Q_UINT32 sessionId) : TransferContext(from,dispatcher,sessionId) { m_direction = P2P::Incoming; @@ -59,19 +59,19 @@ IncomingTransfer::~IncomingTransfer() } -void IncomingTransfer::slotTransferAccepted(Kopete::Transfer* transfer, const QString& /*fileName*/) +void IncomingTransfer::slotTransferAccepted(Kopete::Transfer* transfer, const TQString& /*fileName*/) { Q_UINT32 sessionId = transfer->info().internalId().toUInt(); if(sessionId!=m_sessionId) return; - QObject::connect(transfer , SIGNAL(transferCanceled()), this, SLOT(abort())); + TQObject::connect(transfer , TQT_SIGNAL(transferCanceled()), this, TQT_SLOT(abort())); m_transfer = transfer; - QString content = QString("SessionID: %1\r\n\r\n").arg(sessionId); + TQString content = TQString("SessionID: %1\r\n\r\n").arg(sessionId); sendMessage(OK, content); - QObject::disconnect(Kopete::TransferManager::transferManager(), 0l, this, 0l); + TQObject::disconnect(Kopete::TransferManager::transferManager(), 0l, this, 0l); } void IncomingTransfer::slotTransferRefused(const Kopete::FileTransferInfo& info) @@ -80,12 +80,12 @@ void IncomingTransfer::slotTransferRefused(const Kopete::FileTransferInfo& info) if(sessionId!=m_sessionId) return; - QString content = QString("SessionID: %1\r\n\r\n").arg(sessionId); + TQString content = TQString("SessionID: %1\r\n\r\n").arg(sessionId); // Send the sending client a cancelation message. sendMessage(DECLINE, content); m_state=Finished; - QObject::disconnect(Kopete::TransferManager::transferManager(), 0l, this, 0l); + TQObject::disconnect(Kopete::TransferManager::transferManager(), 0l, this, 0l); } @@ -106,7 +106,7 @@ void IncomingTransfer::acknowledged() // should follow. Otherwise, the file transfer may start right away. if(m_transfer) { - QFile *destination = new QFile(m_transfer->destinationURL().path()); + TQFile *destination = new TQFile(m_transfer->destinationURL().path()); if(!destination->open(IO_WriteOnly)) { m_transfer->slotError(KIO::ERR_CANNOT_OPEN_FOR_WRITING, i18n("Cannot open file for writing")); @@ -141,7 +141,7 @@ void IncomingTransfer::processMessage(const Message& message) { // UserDisplayIcon data or File data is in this message. // Write the recieved data to the file. - kdDebug(14140) << k_funcinfo << QString("Received, %1 bytes").arg(message.header.dataSize) << endl; + kdDebug(14140) << k_funcinfo << TQString("Received, %1 bytes").arg(message.header.dataSize) << endl; m_file->writeBlock(message.body.data(), message.header.dataSize); if(m_transfer){ @@ -178,7 +178,7 @@ void IncomingTransfer::processMessage(const Message& message) { // Data preparation message. //if (m_tempFile->name().isEmpty() == false) { - // QFile::remove(m_tempFile->name()); + // TQFile::remove(m_tempFile->name()); //} m_tempFile = new KTempFile(locateLocal("tmp", "msnpicture--"), ".png"); m_tempFile->setAutoDelete(true); @@ -189,30 +189,30 @@ void IncomingTransfer::processMessage(const Message& message) } else { - QString body = - QCString(message.body.data(), message.header.dataSize); + TQString body = + TQCString(message.body.data(), message.header.dataSize); // kdDebug(14140) << k_funcinfo << "received, " << body << endl; if(body.startsWith("INVITE")) { // Retrieve some MSNSLP headers used when // replying to this INVITE message. - QRegExp regex(";branch=\\{([0-9A-F\\-]*)\\}\r\n"); + TQRegExp regex(";branch=\\{([0-9A-F\\-]*)\\}\r\n"); regex.search(body); m_branch = regex.cap(1); // NOTE Call-ID never changes. - regex = QRegExp("Call-ID: \\{([0-9A-F\\-]*)\\}\r\n"); + regex = TQRegExp("Call-ID: \\{([0-9A-F\\-]*)\\}\r\n"); regex.search(body); m_callId = regex.cap(1); - regex = QRegExp("Bridges: ([^\r\n]*)\r\n"); + regex = TQRegExp("Bridges: ([^\r\n]*)\r\n"); regex.search(body); - QString bridges = regex.cap(1); + TQString bridges = regex.cap(1); // The NetID field is 0 if the Conn-Type is // Direct-Connect or Firewall, otherwise, it is // a randomly generated number. - regex = QRegExp("NetID: (\\-?\\d+)\r\n"); + regex = TQRegExp("NetID: (\\-?\\d+)\r\n"); regex.search(body); - QString netId = regex.cap(1); + TQString netId = regex.cap(1); kdDebug(14140) << "net id, " << netId << endl; // Connection Types // - Direct-Connect @@ -220,9 +220,9 @@ void IncomingTransfer::processMessage(const Message& message) // - IP-Restrict-NAT // - Symmetric-NAT // - Firewall - regex = QRegExp("Conn-Type: ([^\r\n]+)\r\n"); + regex = TQRegExp("Conn-Type: ([^\r\n]+)\r\n"); regex.search(body); - QString connType = regex.cap(1); + TQString connType = regex.cap(1); bool wouldListen = false; if(netId.toUInt() == 0 && connType == "Direct-Connect"){ @@ -235,7 +235,7 @@ void IncomingTransfer::processMessage(const Message& message) #if 1 wouldListen = false; // TODO Direct connection support #endif - QString content; + TQString content; if(wouldListen) { @@ -243,8 +243,8 @@ void IncomingTransfer::processMessage(const Message& message) m_listener = new KServerSocket("", ""); m_listener->setResolutionEnabled(true); // Create the callback that will try to accept incoming connections. - QObject::connect(m_listener, SIGNAL(readyAccept()), SLOT(slotAccept())); - QObject::connect(m_listener, SIGNAL(gotError(int)), this, SLOT(slotListenError(int))); + TQObject::connect(m_listener, TQT_SIGNAL(readyAccept()), TQT_SLOT(slotAccept())); + TQObject::connect(m_listener, TQT_SIGNAL(gotError(int)), this, TQT_SLOT(slotListenError(int))); // Listen for incoming connections. bool isListening = m_listener->listen(1); kdDebug(14140) << k_funcinfo << (isListening ? "listening" : "not listening") << endl; @@ -254,9 +254,9 @@ void IncomingTransfer::processMessage(const Message& message) content = "Bridge: TCPv1\r\n" "Listening: true\r\n" + - QString("Hashed-Nonce: {%1}\r\n").arg(P2P::Uid::createUid()) + - QString("IPv4Internal-Addrs: %1\r\n").arg(m_listener->localAddress().nodeName()) + - QString("IPv4Internal-Port: %1\r\n").arg(m_listener->localAddress().serviceName()) + + TQString("Hashed-Nonce: {%1}\r\n").arg(P2P::Uid::createUid()) + + TQString("IPv4Internal-Addrs: %1\r\n").arg(m_listener->localAddress().nodeName()) + + TQString("IPv4Internal-Port: %1\r\n").arg(m_listener->localAddress().serviceName()) + "\r\n"; } else @@ -349,11 +349,11 @@ void IncomingTransfer::slotAccept() m_socket->enableWrite(false); // Create the callback that will try to read bytes from the accepted socket. - QObject::connect(m_socket, SIGNAL(readyRead()), this, SLOT(slotSocketRead())); + TQObject::connect(m_socket, TQT_SIGNAL(readyRead()), this, TQT_SLOT(slotSocketRead())); // Create the callback that will try to handle the socket close event. - QObject::connect(m_socket, SIGNAL(closed()), this, SLOT(slotSocketClosed())); + TQObject::connect(m_socket, TQT_SIGNAL(closed()), this, TQT_SLOT(slotSocketClosed())); // Create the callback that will try to handle the socket error event. - QObject::connect(m_socket, SIGNAL(gotError(int)), this, SLOT(slotSocketError(int))); + TQObject::connect(m_socket, TQT_SIGNAL(gotError(int)), this, TQT_SLOT(slotSocketError(int))); } void IncomingTransfer::slotSocketRead() @@ -362,10 +362,10 @@ void IncomingTransfer::slotSocketRead() kdDebug(14140) << k_funcinfo << available << ", bytes available." << endl; if(available > 0) { - QByteArray buffer(available); + TQByteArray buffer(available); m_socket->readBlock(buffer.data(), buffer.size()); - if(QString(buffer) == "foo"){ + if(TQString(buffer) == "foo"){ kdDebug(14140) << "Connection Check." << endl; } } |