summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/msn/webcam.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/protocols/msn/webcam.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-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/webcam.cpp')
-rw-r--r--kopete/protocols/msn/webcam.cpp196
1 files changed, 98 insertions, 98 deletions
diff --git a/kopete/protocols/msn/webcam.cpp b/kopete/protocols/msn/webcam.cpp
index db27d65f..60ce0e82 100644
--- a/kopete/protocols/msn/webcam.cpp
+++ b/kopete/protocols/msn/webcam.cpp
@@ -18,16 +18,16 @@
#include <stdlib.h>
#include <kdebug.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <kbufferedsocket.h>
#include <klocale.h>
#include <kserversocket.h>
#include <kmessagebox.h>
-#include <qlabel.h>
-#include <qguardedptr.h>
-#include <qtimer.h>
-#include <qevent.h>
-#include <qdatetime.h>
+#include <tqlabel.h>
+#include <tqguardedptr.h>
+#include <tqtimer.h>
+#include <tqevent.h>
+#include <tqdatetime.h>
#include <kconfig.h>
#include "dispatcher.h"
@@ -42,7 +42,7 @@ using namespace KNetwork;
namespace P2P {
-Webcam::Webcam(Who who, const QString& to, Dispatcher *parent, Q_UINT32 sessionId)
+Webcam::Webcam(Who who, const TQString& to, Dispatcher *parent, Q_UINT32 sessionId)
: TransferContext(to,parent,sessionId) , m_who(who) , m_timerId(0)
{
setType(P2P::WebcamType);
@@ -83,8 +83,8 @@ void Webcam::askIncommingInvitation()
{
m_direction = Incoming;
//protect, in case this is deleted when the messagebox is active
- QGuardedPtr<Webcam> _this = this;
- QString message= (m_who==wProducer) ?
+ TQGuardedPtr<Webcam> _this = this;
+ TQString message= (m_who==wProducer) ?
i18n("<qt>The contact %1 wants to see <b>your</b> webcam, do you want them to see it?</qt>") :
i18n("The contact %1 wants to show you his/her webcam, do you want to see it?") ;
int result=KMessageBox::questionYesNo( 0L , message.arg(m_recipient),
@@ -92,7 +92,7 @@ void Webcam::askIncommingInvitation()
if(!_this)
return;
- QString content = QString("SessionID: %1\r\n\r\n").arg(m_sessionId);
+ TQString content = TQString("SessionID: %1\r\n\r\n").arg(m_sessionId);
if(result==KMessageBox::Yes)
{
//Send two message, an OK, and an invite.
@@ -107,7 +107,7 @@ void Webcam::askIncommingInvitation()
m_branch=Uid::createUid();
m_state = Negotiation; //set type to application/x-msnmsgr-transreqbody
- content=QString("Bridges: TRUDPv1 TCPv1\r\n"
+ content=TQString("Bridges: TRUDPv1 TCPv1\r\n"
"NetID: -1280904111\r\n"
"Conn-Type: Firewall\r\n"
"UPnPNat: false\r\n"
@@ -127,11 +127,11 @@ void Webcam::askIncommingInvitation()
void Webcam::sendBYEMessage()
{
m_state=Finished;
- QString content="Context: dAMAgQ==\r\n";
+ TQString content="Context: dAMAgQ==\r\n";
sendMessage(BYE,content);
//If ever the opposite client was dead or something, we'll ack anyway, so everything get cleaned
- QTimer::singleShot(60*1000 , this, SLOT(acknowledged()));
+ TQTimer::singleShot(60*1000 , this, TQT_SLOT(acknowledged()));
}
@@ -203,7 +203,7 @@ void Webcam::processMessage(const Message& message)
if(message.applicationIdentifier != 4l)
{
- QString body = QCString(message.body.data(), message.header.dataSize);
+ TQString body = TQCString(message.body.data(), message.header.dataSize);
kdDebug(14141) << k_funcinfo << "received, " << body << endl;
if(body.startsWith("MSNSLP/1.0 200 OK"))
@@ -214,7 +214,7 @@ void Webcam::processMessage(const Message& message)
{
if(m_direction == Outgoing)
{
- QRegExp regex(";branch=\\{([0-9A-F\\-]*)\\}\r\n");
+ TQRegExp regex(";branch=\\{([0-9A-F\\-]*)\\}\r\n");
regex.search(body);
m_branch=regex.cap(1);
//decline
@@ -242,10 +242,10 @@ void Webcam::processMessage(const Message& message)
//Let's take the fun, we entering into the delicious webcam negotiation binary protocol
//well, there is maybe better to take utf16, but it's ascii, so no problem.
- QByteArray dataMessage=message.body;
+ TQByteArray dataMessage=message.body;
#if 0
- QString echoS="";
+ TQString echoS="";
unsigned int f=0;
while(f<dataMessage.size())
{
@@ -257,7 +257,7 @@ void Webcam::processMessage(const Message& message)
unsigned int N=(unsigned int) (dataMessage[q+f]);
if(N<16)
echoS+="0";
- echoS+=QString::number( N ,16)+" ";
+ echoS+=TQString::number( N ,16)+" ";
}
else
echoS+=" ";
@@ -268,7 +268,7 @@ void Webcam::processMessage(const Message& message)
{
unsigned char X=dataMessage[q+f];
char C=((char)(( X<128 && X>31 ) ? X : '.'));
- echoS+=QString::fromLatin1(&C,1);
+ echoS+=TQString::fromLatin1(&C,1);
}
f+=16;
}
@@ -305,31 +305,31 @@ void Webcam::processMessage(const Message& message)
{
uint sess=rand()%1000+5000;
uint rid=rand()%100+50;
- m_myAuth=QString("recipientid=%1&sessionid=%2\r\n\r\n").arg(rid).arg(sess);
+ m_myAuth=TQString("recipientid=%1&sessionid=%2\r\n\r\n").arg(rid).arg(sess);
kdDebug(14140) << k_funcinfo << "m_myAuth= " << m_myAuth << endl;
- QString producerxml=xml(sess , rid);
+ TQString producerxml=xml(sess , rid);
kdDebug(14140) << k_funcinfo << "producerxml= " << producerxml << endl;
makeSIPMessage(producerxml);
}
}
else if(m_content.contains("<producer>") || m_content.contains("<viewer>"))
{
- QRegExp rx("<rid>([0-9]*)</rid>.*<session>([0-9]*)</session>");
+ TQRegExp rx("<rid>([0-9]*)</rid>.*<session>([0-9]*)</session>");
rx.search(m_content);
- QString rid=rx.cap(1);
- QString sess=rx.cap(2);
+ TQString rid=rx.cap(1);
+ TQString sess=rx.cap(2);
if(m_content.contains("<producer>"))
{
- QString viewerxml=xml(sess.toUInt() , rid.toUInt());
+ TQString viewerxml=xml(sess.toUInt() , rid.toUInt());
kdDebug(14140) << k_funcinfo << "vewerxml= " << viewerxml << endl;
makeSIPMessage( viewerxml ,0x00,0x09,0x00 );
- m_peerAuth=m_myAuth=QString("recipientid=%1&sessionid=%2\r\n\r\n").arg(rid,sess);
+ m_peerAuth=m_myAuth=TQString("recipientid=%1&sessionid=%2\r\n\r\n").arg(rid,sess);
kdDebug(14140) << k_funcinfo << "m_auth= " << m_myAuth << endl;
}
else
{
- m_peerAuth=QString("recipientid=%1&sessionid=%2\r\n\r\n").arg(rid,sess);
+ m_peerAuth=TQString("recipientid=%1&sessionid=%2\r\n\r\n").arg(rid,sess);
makeSIPMessage("receivedViewerData", 0xec , 0xda , 0x03);
}
@@ -342,39 +342,39 @@ void Webcam::processMessage(const Message& message)
}
//m_listener->setResolutionEnabled(true);
// Create the callback that will try to accept incoming connections.
- QObject::connect(m_listener, SIGNAL(readyAccept()), this, SLOT(slotAccept()));
- QObject::connect(m_listener, SIGNAL(gotError(int)), this, SLOT(slotListenError(int)));
+ TQObject::connect(m_listener, TQT_SIGNAL(readyAccept()), this, 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();
- kdDebug(14140) << k_funcinfo << (isListening ? QString("listening %1").arg(m_listener->localAddress().toString()) : QString("not listening")) << endl;
+ kdDebug(14140) << k_funcinfo << (isListening ? TQString("listening %1").arg(m_listener->localAddress().toString()) : TQString("not listening")) << endl;
- rx=QRegExp("<tcpport>([^<]*)</tcpport>");
+ rx=TQRegExp("<tcpport>([^<]*)</tcpport>");
rx.search(m_content);
- QString port1=rx.cap(1);
+ TQString port1=rx.cap(1);
if(port1=="0")
- port1=QString::null;
+ port1=TQString::null;
- rx=QRegExp("<tcplocalport>([^<]*)</tcplocalport>");
+ rx=TQRegExp("<tcplocalport>([^<]*)</tcplocalport>");
rx.search(m_content);
- QString port2=rx.cap(1);
+ TQString port2=rx.cap(1);
if(port2==port1 || port2=="0")
- port2=QString::null;
+ port2=TQString::null;
- rx=QRegExp("<tcpexternalport>([^<]*)</tcpexternalport>");
+ rx=TQRegExp("<tcpexternalport>([^<]*)</tcpexternalport>");
rx.search(m_content);
- QString port3=rx.cap(1);
+ TQString port3=rx.cap(1);
if(port3==port1 || port3==port2 || port3=="0")
- port3=QString::null;
+ port3=TQString::null;
int an=0;
while(true)
{
an++;
- if(!m_content.contains( QString("<tcpipaddress%1>").arg(an) ))
+ if(!m_content.contains( TQString("<tcpipaddress%1>").arg(an) ))
break;
- rx=QRegExp(QString("<tcpipaddress%1>([^<]*)</tcpipaddress%2>").arg(an).arg(an));
+ rx=TQRegExp(TQString("<tcpipaddress%1>([^<]*)</tcpipaddress%2>").arg(an).arg(an));
rx.search(m_content);
- QString ip=rx.cap(1);
+ TQString ip=rx.cap(1);
if(ip.isNull())
continue;
@@ -383,8 +383,8 @@ void Webcam::processMessage(const Message& message)
kdDebug(14140) << k_funcinfo << "trying to connect on " << ip <<":" << port1 << endl;
KBufferedSocket *sock=new KBufferedSocket( ip, port1, this );
m_allSockets.append(sock);
- QObject::connect( sock, SIGNAL( connected( const KResolverEntry&) ), this, SLOT( slotSocketConnected() ) );
- QObject::connect( sock, SIGNAL( gotError(int)), this, SLOT(slotSocketError(int)));
+ TQObject::connect( sock, TQT_SIGNAL( connected( const KResolverEntry&) ), this, TQT_SLOT( slotSocketConnected() ) );
+ TQObject::connect( sock, TQT_SIGNAL( gotError(int)), this, TQT_SLOT(slotSocketError(int)));
sock->connect(ip, port1);
kdDebug(14140) << k_funcinfo << "okok " << sock << " - " << sock->peerAddress().toString() << " ; " << sock->localAddress().toString() << endl;
}
@@ -393,8 +393,8 @@ void Webcam::processMessage(const Message& message)
kdDebug(14140) << k_funcinfo << "trying to connect on " << ip <<":" << port2 << endl;
KBufferedSocket *sock=new KBufferedSocket( ip, port2, this );
m_allSockets.append(sock);
- QObject::connect( sock, SIGNAL( connected( const KResolverEntry&) ), this, SLOT( slotSocketConnected() ) );
- QObject::connect( sock, SIGNAL( gotError(int)), this, SLOT(slotSocketError(int)));
+ TQObject::connect( sock, TQT_SIGNAL( connected( const KResolverEntry&) ), this, TQT_SLOT( slotSocketConnected() ) );
+ TQObject::connect( sock, TQT_SIGNAL( gotError(int)), this, TQT_SLOT(slotSocketError(int)));
sock->connect(ip, port2);
}
if(!port3.isNull())
@@ -402,12 +402,12 @@ void Webcam::processMessage(const Message& message)
kdDebug(14140) << k_funcinfo << "trying to connect on " << ip <<":" << port3 << endl;
KBufferedSocket *sock=new KBufferedSocket( ip, port3, this );
m_allSockets.append(sock);
- QObject::connect( sock, SIGNAL( connected( const KResolverEntry&) ), this, SLOT( slotSocketConnected() ) );
- QObject::connect( sock, SIGNAL( gotError(int)), this, SLOT(slotSocketError(int)));
+ TQObject::connect( sock, TQT_SIGNAL( connected( const KResolverEntry&) ), this, TQT_SLOT( slotSocketConnected() ) );
+ TQObject::connect( sock, TQT_SIGNAL( gotError(int)), this, TQT_SLOT(slotSocketError(int)));
sock->connect(ip, port3);
}
}
- QValueList<KBufferedSocket*>::iterator it;
+ TQValueList<KBufferedSocket*>::iterator it;
for ( it = m_allSockets.begin(); it != m_allSockets.end(); ++it )
{
KBufferedSocket *sock=(*it);
@@ -422,14 +422,14 @@ void Webcam::processMessage(const Message& message)
}
else
error();
- m_content=QString::null;
+ m_content=TQString::null;
}
-void Webcam::makeSIPMessage(const QString &message, Q_UINT8 XX, Q_UINT8 YY , Q_UINT8 ZZ)
+void Webcam::makeSIPMessage(const TQString &message, Q_UINT8 XX, Q_UINT8 YY , Q_UINT8 ZZ)
{
- QByteArray dataMessage; //(12+message.length()*2);
- QDataStream writer(dataMessage, IO_WriteOnly);
- writer.setByteOrder(QDataStream::LittleEndian);
+ TQByteArray dataMessage; //(12+message.length()*2);
+ TQDataStream writer(dataMessage, IO_WriteOnly);
+ writer.setByteOrder(TQDataStream::LittleEndian);
writer << (Q_UINT8)0x80;
writer << (Q_UINT8)XX;
writer << (Q_UINT8)YY;
@@ -439,7 +439,7 @@ void Webcam::makeSIPMessage(const QString &message, Q_UINT8 XX, Q_UINT8 YY , Q_U
writer << message+'\0';
//writer << (Q_UINT16)0x0000;
- /*QString echoS="";
+ /*TQString echoS="";
unsigned int f=0;
while(f<dataMessage.size())
{
@@ -451,7 +451,7 @@ void Webcam::makeSIPMessage(const QString &message, Q_UINT8 XX, Q_UINT8 YY , Q_U
unsigned int N=(unsigned int) (dataMessage[q+f]);
if(N<16)
echoS+="0";
- echoS+=QString::number( N ,16)+" ";
+ echoS+=TQString::number( N ,16)+" ";
}
else
echoS+=" ";
@@ -462,7 +462,7 @@ void Webcam::makeSIPMessage(const QString &message, Q_UINT8 XX, Q_UINT8 YY , Q_U
{
unsigned char X=dataMessage[q+f];
char C=((char)(( X<128 && X>31 ) ? X : '.'));
- echoS+=QString::fromLatin1(&C,1);
+ echoS+=TQString::fromLatin1(&C,1);
}
f+=16;
}
@@ -472,7 +472,7 @@ void Webcam::makeSIPMessage(const QString &message, Q_UINT8 XX, Q_UINT8 YY , Q_U
sendBigP2PMessage(dataMessage);
}
-void Webcam::sendBigP2PMessage( const QByteArray & dataMessage)
+void Webcam::sendBigP2PMessage( const TQByteArray & dataMessage)
{
unsigned int size=m_totalDataSize=dataMessage.size();
m_offset=0;
@@ -481,7 +481,7 @@ void Webcam::sendBigP2PMessage( const QByteArray & dataMessage)
for(unsigned int f=0;f<size;f+=1200)
{
m_offset=f;
- QByteArray dm2;
+ TQByteArray dm2;
dm2.duplicate(dataMessage.data()+m_offset, QMIN(1200,m_totalDataSize-m_offset));
sendData( dm2 );
m_offset+=dm2.size();
@@ -492,26 +492,26 @@ void Webcam::sendBigP2PMessage( const QByteArray & dataMessage)
-QString Webcam::xml(uint session , uint rid)
+TQString Webcam::xml(uint session , uint rid)
{
- QString who= ( m_who == wProducer ) ? QString("producer") : QString("viewer");
+ TQString who= ( m_who == wProducer ) ? TQString("producer") : TQString("viewer");
- QString ip;
+ TQString ip;
uint ip_number=1;
- QStringList::iterator it;
- QStringList ips=m_dispatcher->localIp();
+ TQStringList::iterator it;
+ TQStringList ips=m_dispatcher->localIp();
for ( it = ips.begin(); it != ips.end(); ++it )
{
- ip+=QString("<tcpipaddress%1>%2</tcpipaddress%3>").arg(ip_number).arg(*it).arg(ip_number);
+ ip+=TQString("<tcpipaddress%1>%2</tcpipaddress%3>").arg(ip_number).arg(*it).arg(ip_number);
++ip_number;
}
- QString port = QString::number(getAvailablePort());
+ TQString port = TQString::number(getAvailablePort());
m_listener = new KServerSocket(port, this) ;
- return "<" + who + "><version>2.0</version><rid>"+QString::number(rid)+"</rid><udprid>"+QString::number(rid+1)+"</udprid><session>"+QString::number(session)+"</session><ctypes>0</ctypes><cpu>2931</cpu>" +
+ return "<" + who + "><version>2.0</version><rid>"+TQString::number(rid)+"</rid><udprid>"+TQString::number(rid+1)+"</udprid><session>"+TQString::number(session)+"</session><ctypes>0</ctypes><cpu>2931</cpu>" +
"<tcp><tcpport>"+port+"</tcpport>\t\t\t\t\t\t\t\t <tcplocalport>"+port+"</tcplocalport>\t\t\t\t\t\t\t\t <tcpexternalport>"+port+"</tcpexternalport>"+ip+"</tcp>"+
"<udp><udplocalport>7786</udplocalport><udpexternalport>31863</udpexternalport><udpexternalip>"+ ip +"</udpexternalip><a1_port>31859</a1_port><b1_port>31860</b1_port><b2_port>31861</b2_port><b3_port>31862</b3_port><symmetricallocation>1</symmetricallocation><symmetricallocationincrement>1</symmetricallocationincrement><udpversion>1</udpversion><udpinternalipaddress1>127.0.0.1</udpinternalipaddress1></udp>"+
"<codec></codec><channelmode>1</channelmode></"+who+">\r\n\r\n";
@@ -521,7 +521,7 @@ int Webcam::getAvailablePort()
{
KConfig *config = KGlobal::config();
config->setGroup( "MSN" );
- QString basePort=config->readEntry("WebcamPort");
+ TQString basePort=config->readEntry("WebcamPort");
if(basePort.isEmpty() || basePort == "0" )
basePort="6891";
@@ -536,7 +536,7 @@ int Webcam::getAvailablePort()
bool found = false;
unsigned int port = firstport;
for( ; port <= lastport; ++port) {
- ss->setAddress( QString::number( port ) );
+ ss->setAddress( TQString::number( port ) );
bool success = ss->listen();
if( found = ( success && ss->error() == KSocketBase::NoError ) )
break;
@@ -568,14 +568,14 @@ void Webcam::slotSocketConnected()
m_webcamSocket->enableWrite(false);
// Create the callback that will try to read bytes from the accepted socket.
- QObject::connect(m_webcamSocket, SIGNAL(readyRead()), this, SLOT(slotSocketRead()));
+ TQObject::connect(m_webcamSocket, TQT_SIGNAL(readyRead()), this, TQT_SLOT(slotSocketRead()));
// Create the callback that will try to handle the socket close event.
- QObject::connect(m_webcamSocket, SIGNAL(closed()), this, SLOT(slotSocketClosed()));
+ TQObject::connect(m_webcamSocket, TQT_SIGNAL(closed()), this, TQT_SLOT(slotSocketClosed()));
// Create the callback that will try to handle the socket error event.
-// QObject::connect(m_webcamSocket, SIGNAL(gotError(int)), this, SLOT(slotSocketError(int)));
+// TQObject::connect(m_webcamSocket, TQT_SIGNAL(gotError(int)), this, TQT_SLOT(slotSocketError(int)));
m_webcamStates[m_webcamSocket]=wsConnected;
- QCString to_send=m_peerAuth.utf8();
+ TQCString to_send=m_peerAuth.utf8();
m_webcamSocket->writeBlock(to_send.data(), to_send.length());
kdDebug(14140) << k_funcinfo << "sending "<< m_peerAuth << endl;
@@ -608,11 +608,11 @@ void Webcam::slotAccept()
m_webcamSocket->enableWrite(false);
// Create the callback that will try to read bytes from the accepted socket.
- QObject::connect(m_webcamSocket, SIGNAL(readyRead()), this, SLOT(slotSocketRead()));
+ TQObject::connect(m_webcamSocket, TQT_SIGNAL(readyRead()), this, TQT_SLOT(slotSocketRead()));
// Create the callback that will try to handle the socket close event.
- QObject::connect(m_webcamSocket, SIGNAL(closed()), this, SLOT(slotSocketClosed()));
+ TQObject::connect(m_webcamSocket, TQT_SIGNAL(closed()), this, TQT_SLOT(slotSocketClosed()));
// Create the callback that will try to handle the socket error event.
- QObject::connect(m_webcamSocket, SIGNAL(gotError(int)), this, SLOT(slotSocketError(int)));
+ TQObject::connect(m_webcamSocket, TQT_SIGNAL(gotError(int)), this, TQT_SLOT(slotSocketError(int)));
m_allSockets.append(m_webcamSocket);
m_webcamStates[m_webcamSocket]=wsNegotiating;
@@ -625,14 +625,14 @@ void Webcam::slotSocketRead()
uint available = m_webcamSocket->bytesAvailable();
kdDebug(14140) << k_funcinfo << m_webcamSocket << "############# " << available << " bytes available." << endl;
- QByteArray avail_buff(available);
+ TQByteArray avail_buff(available);
m_webcamSocket->peekBlock(avail_buff.data(), avail_buff.size());
kdDebug(14140) << k_funcinfo << m_webcamSocket << avail_buff << endl;
- const QString connected_str("connected\r\n\r\n");
+ const TQString connected_str("connected\r\n\r\n");
switch(m_webcamStates[m_webcamSocket])
{
case wsNegotiating:
@@ -642,16 +642,16 @@ void Webcam::slotSocketRead()
kdDebug(14140) << k_funcinfo << "waiting more data ( " << available << " of " <<m_myAuth.length()<< " )"<< endl;
break;
}
- QByteArray buffer(available);
+ TQByteArray buffer(available);
m_webcamSocket->readBlock(buffer.data(), buffer.size());
kdDebug(14140) << k_funcinfo << buffer.data() << endl;
- if(QString(buffer) == m_myAuth )
+ if(TQString(buffer) == m_myAuth )
{
closeAllOtherSockets();
kdDebug(14140) << k_funcinfo << "Sending " << connected_str << endl;
- QCString conne=connected_str.utf8();
+ TQCString conne=connected_str.utf8();
m_webcamSocket->writeBlock(conne.data(), conne.length());
m_webcamStates[m_webcamSocket]=wsConnecting;
@@ -668,7 +668,7 @@ void Webcam::slotSocketRead()
kdDebug(14140) << k_funcinfo << "new timer" << m_timerId << endl;
}
m_widget=new MSNWebcamDialog(m_recipient);
- connect(m_widget, SIGNAL( closingWebcamDialog() ) , this , SLOT(sendBYEMessage()));
+ connect(m_widget, TQT_SIGNAL( closingWebcamDialog() ) , this , TQT_SLOT(sendBYEMessage()));
}
else
@@ -690,19 +690,19 @@ void Webcam::slotSocketRead()
kdDebug(14140) << k_funcinfo << "waiting more data ( " << available << " of " <<connected_str.length()<< " )"<< endl;
break;
}
- QByteArray buffer(connected_str.length());
+ TQByteArray buffer(connected_str.length());
m_webcamSocket->readBlock(buffer.data(), buffer.size());
-// kdDebug(14140) << k_funcinfo << "state " << m_webcamState << " received :" << QCString(buffer) << endl;
+// kdDebug(14140) << k_funcinfo << "state " << m_webcamState << " received :" << TQCString(buffer) << endl;
- if(QString(buffer) == connected_str)
+ if(TQString(buffer) == connected_str)
{
if(m_webcamStates[m_webcamSocket]==wsConnected)
{
closeAllOtherSockets();
kdDebug(14140) << k_funcinfo << "Sending " << connected_str << endl;
- QCString conne=connected_str.utf8();
+ TQCString conne=connected_str.utf8();
m_webcamSocket->writeBlock(conne.data(), conne.length());
//SHOULD BE DONE IN ALL CASE
@@ -718,7 +718,7 @@ void Webcam::slotSocketRead()
kdDebug(14140) << k_funcinfo << "new timer" << m_timerId << endl;
}
m_widget=new MSNWebcamDialog(m_recipient);
- connect(m_widget, SIGNAL( closingWebcamDialog() ) , this , SLOT(sendBYEMessage()));
+ connect(m_widget, TQT_SIGNAL( closingWebcamDialog() ) , this , TQT_SLOT(sendBYEMessage()));
}
m_webcamStates[m_webcamSocket]=wsTransfer;
@@ -746,7 +746,7 @@ void Webcam::slotSocketRead()
kdDebug(14140) << k_funcinfo << "waiting more data ( " << available << " of " <<24<< " )"<< endl;
break;
}
- QByteArray buffer(24);
+ TQByteArray buffer(24);
m_webcamSocket->peekBlock(buffer.data(), buffer.size());
Q_UINT32 paysize=(uchar)buffer[8] + ((uchar)buffer[9]<<8) + ((uchar)buffer[10]<<16) + ((uchar)buffer[11]<<24);
@@ -760,7 +760,7 @@ void Webcam::slotSocketRead()
buffer.resize(paysize);
m_webcamSocket->readBlock(buffer.data(), buffer.size());
- QPixmap pix=m_mimic->decode(buffer);
+ TQPixmap pix=m_mimic->decode(buffer);
if(pix.isNull())
{
kdWarning(14140) << k_funcinfo << "incorrect pixmap returned, better to stop everything"<< endl;
@@ -815,7 +815,7 @@ void Webcam::closeAllOtherSockets()
delete m_listener;
m_listener=0l;
- QValueList<KBufferedSocket*>::iterator it;
+ TQValueList<KBufferedSocket*>::iterator it;
for ( it = m_allSockets.begin(); it != m_allSockets.end(); ++it )
{
KBufferedSocket *sock=(*it);
@@ -826,7 +826,7 @@ void Webcam::closeAllOtherSockets()
}
-void Webcam::timerEvent( QTimerEvent *e )
+void Webcam::timerEvent( TQTimerEvent *e )
{
if(e->timerId() != m_timerId)
return TransferContext::timerEvent(e);
@@ -835,7 +835,7 @@ void Webcam::timerEvent( QTimerEvent *e )
Kopete::AV::VideoDevicePool *videoDevice = Kopete::AV::VideoDevicePool::self();
videoDevice->getFrame();
- QImage img;
+ TQImage img;
videoDevice->getImage(&img);
if(m_widget)
@@ -848,7 +848,7 @@ void Webcam::timerEvent( QTimerEvent *e )
}
uchar *bits=img.bits();
- QByteArray image_data(img.width()*img.height()*3);
+ TQByteArray image_data(img.width()*img.height()*3);
uint b2=0;
uint imgsize=img.width()*img.height()*4;
for(uint f=0; f< imgsize; f+=4)
@@ -859,15 +859,15 @@ void Webcam::timerEvent( QTimerEvent *e )
b2+=3;
}
- QByteArray frame=m_mimic->encode(image_data);
+ TQByteArray frame=m_mimic->encode(image_data);
kdDebug(14140) << k_funcinfo << "Sendinf frame of size " << frame.size() << endl;
//build the header.
- QByteArray header;
+ TQByteArray header;
- QDataStream writer(header, IO_WriteOnly);
- writer.setByteOrder(QDataStream::LittleEndian);
+ TQDataStream writer(header, IO_WriteOnly);
+ writer.setByteOrder(TQDataStream::LittleEndian);
writer << (Q_UINT16)24; // header size
writer << (Q_UINT16)img.width();
writer << (Q_UINT16)img.height();
@@ -875,7 +875,7 @@ void Webcam::timerEvent( QTimerEvent *e )
writer << (Q_UINT32)frame.size();
writer << (Q_UINT8)('M') << (Q_UINT8)('L') << (Q_UINT8)('2') << (Q_UINT8)('0');
writer << (Q_UINT32)0x00000000; //wtf .?
- writer << QTime::currentTime(); //FIXME: possible midnight bug ?
+ writer << TQTime::currentTime(); //FIXME: possible midnight bug ?
m_webcamSocket->writeBlock(header.data(), header.size());
m_webcamSocket->writeBlock(frame.data(), frame.size());