diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kopete/protocols/yahoo/libkyahoo/webcamtask.cpp | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip |
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/yahoo/libkyahoo/webcamtask.cpp')
-rw-r--r-- | kopete/protocols/yahoo/libkyahoo/webcamtask.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/kopete/protocols/yahoo/libkyahoo/webcamtask.cpp b/kopete/protocols/yahoo/libkyahoo/webcamtask.cpp index 2ad978f2..41d5019d 100644 --- a/kopete/protocols/yahoo/libkyahoo/webcamtask.cpp +++ b/kopete/protocols/yahoo/libkyahoo/webcamtask.cpp @@ -33,7 +33,7 @@ using namespace KNetwork; -WebcamTask::WebcamTask(Task* parent) : Task(parent) +WebcamTask::WebcamTask(Task* tqparent) : Task(tqparent) { kdDebug(YAHOO_RAW_DEBUG) ; transmittingData = false; @@ -94,7 +94,7 @@ void WebcamTask::parseWebcamInformation( YMSGTransfer *t ) info.sender = keyPending; info.server = t->firstParam( 102 ); info.key = t->firstParam( 61 ); - info.status = InitialStatus; + info.status = InitialtqStatus; info.dataLength = 0; info.buffer = 0L; info.headerRead = false; @@ -135,7 +135,7 @@ void WebcamTask::slotConnectionStage1Established() if( socketMap[socket].direction == Incoming ) { socket->writeBlock( TQCString("<RVWCFG>").data(), 8 ); - s = TQString("g=%1\r\n").arg(socketMap[socket].sender); + s = TQString("g=%1\r\n").tqarg(socketMap[socket].sender); } else { @@ -144,7 +144,7 @@ void WebcamTask::slotConnectionStage1Established() } // Header: 08 00 01 00 00 00 00 - stream << (Q_INT8)0x08 << (Q_INT8)0x00 << (Q_INT8)0x01 << (Q_INT8)0x00 << (Q_INT32)s.length(); + stream << (TQ_INT8)0x08 << (TQ_INT8)0x00 << (TQ_INT8)0x01 << (TQ_INT8)0x00 << (TQ_INT32)s.length(); stream.writeRawBytes( s.local8Bit(), s.length() ); socket->writeBlock( buffer.data(), buffer.size() ); @@ -168,24 +168,24 @@ void WebcamTask::slotConnectionStage2Established() if( socketMap[socket].direction == Incoming ) { - // Send <REQIMG>-Packet - socket->writeBlock( TQCString("<REQIMG>").data(), 8 ); + // Send <RETQIMG>-Packet + socket->writeBlock( TQCString("<RETQIMG>").data(), 8 ); // Send request information s = TQString("a=2\r\nc=us\r\ne=21\r\nu=%1\r\nt=%2\r\ni=\r\ng=%3\r\no=w-2-5-1\r\np=1") - .arg(client()->userId()).arg(socketMap[socket].key).arg(socketMap[socket].sender); + .tqarg(client()->userId()).tqarg(socketMap[socket].key).tqarg(socketMap[socket].sender); // Header: 08 00 01 00 00 00 00 - stream << (Q_INT8)0x08 << (Q_INT8)0x00 << (Q_INT8)0x01 << (Q_INT8)0x00 << (Q_INT32)s.length(); + stream << (TQ_INT8)0x08 << (TQ_INT8)0x00 << (TQ_INT8)0x01 << (TQ_INT8)0x00 << (TQ_INT32)s.length(); } else { - // Send <REQIMG>-Packet + // Send <RETQIMG>-Packet socket->writeBlock( TQCString("<SNDIMG>").data(), 8 ); // Send request information s = TQString("a=2\r\nc=us\r\nu=%1\r\nt=%2\r\ni=%3\r\no=w-2-5-1\r\np=2\r\nb=KopeteWebcam\r\nd=\r\n") - .arg(client()->userId()).arg(socketMap[socket].key).arg(socket->localAddress().nodeName()); + .tqarg(client()->userId()).tqarg(socketMap[socket].key).tqarg(socket->localAddress().nodeName()); // Header: 08 00 05 00 00 00 00 01 00 00 00 01 - stream << (Q_INT8)0x0d << (Q_INT8)0x00 << (Q_INT8)0x05 << (Q_INT8)0x00 << (Q_INT32)s.length() - << (Q_INT8)0x01 << (Q_INT8)0x00 << (Q_INT8)0x00 << (Q_INT8)0x00 << (Q_INT8)0x01; + stream << (TQ_INT8)0x0d << (TQ_INT8)0x00 << (TQ_INT8)0x05 << (TQ_INT8)0x00 << (TQ_INT32)s.length() + << (TQ_INT8)0x01 << (TQ_INT8)0x00 << (TQ_INT8)0x00 << (TQ_INT8)0x00 << (TQ_INT8)0x01; } socket->writeBlock( buffer.data(), buffer.size() ); @@ -195,9 +195,9 @@ void WebcamTask::slotConnectionStage2Established() void WebcamTask::slotConnectionFailed( int error ) { KStreamSocket* socket = const_cast<KStreamSocket*>( dynamic_cast<const KStreamSocket*>( sender() ) ); - kdDebug(YAHOO_RAW_DEBUG) << "Webcam connection to the user " << socketMap[socket].sender << " failed. Error " << error << " - " << socket->errorString() << endl; + kdDebug(YAHOO_RAW_DEBUG) << "Webcam connection to the user " << socketMap[socket].sender << " failed. Error " << error << " - " << socket->KSocketBase::errorString() << endl; client()->notifyError( i18n("Webcam connection to the user %1 could not be established.\n\nPlease relogin and try again.") - .arg(socketMap[socket].sender), TQString("%1 - %2").arg(error).arg( socket->errorString()), Client::Error ); + .tqarg(socketMap[socket].sender), TQString("%1 - %2").tqarg(error).tqarg( socket->KSocketBase::errorString()), Client::Error ); socketMap.remove( socket ); socket->deleteLater(); } @@ -237,12 +237,12 @@ void WebcamTask::connectStage2( KStreamSocket *socket ) KStreamSocket *newSocket; switch( (const char)data[2] ) { - case (Q_INT8)0x06: + case (TQ_INT8)0x06: emit webcamNotAvailable(socketMap[socket].sender); break; - case (Q_INT8)0x04: - case (Q_INT8)0x07: - while( (const char)data[i] != (Q_INT8)0x00 ) + case (TQ_INT8)0x04: + case (TQ_INT8)0x07: + while( (const char)data[i] != (TQ_INT8)0x00 ) server += data[i++]; kdDebug(YAHOO_RAW_DEBUG) << "Server:" << server << endl; if( server.isEmpty() ) @@ -355,7 +355,7 @@ void WebcamTask::parseData( TQByteArray &data, KStreamSocket *socket ) // Send Invitation packets for(it = pendingInvitations.begin(); it != pendingInvitations.end(); it++) { - SendNotifyTask *snt = new SendNotifyTask( parent() ); + SendNotifyTask *snt = new SendNotifyTask( tqparent() ); snt->setTarget( *it ); snt->setType( SendNotifyTask::NotifyWebcamInvite ); snt->go( true ); @@ -425,9 +425,9 @@ void WebcamTask::parseData( TQByteArray &data, KStreamSocket *socket ) case UserRequest: { who.append( info->buffer->buffer() ); - who = who.mid( 2, who.find('\n') - 3); - kdDebug(YAHOO_RAW_DEBUG) << "User wants to view webcam: " << who << " len: " << who.length() << " Index: " << accessGranted.findIndex( who ) << endl; - if( accessGranted.findIndex( who ) >= 0 ) + who = who.mid( 2, who.tqfind('\n') - 3); + kdDebug(YAHOO_RAW_DEBUG) << "User wants to view webcam: " << who << " len: " << who.length() << " Index: " << accessGranted.tqfindIndex( who ) << endl; + if( accessGranted.tqfindIndex( who ) >= 0 ) { grantAccess( who ); } @@ -579,10 +579,10 @@ void WebcamTask::grantAccess( const TQString &userId ) } TQByteArray ar; TQDataStream stream( ar, IO_WriteOnly ); - TQString user = TQString("u=%1").arg(userId); + TQString user = TQString("u=%1").tqarg(userId); - stream << (Q_INT8)0x0d << (Q_INT8)0x00 << (Q_INT8)0x05 << (Q_INT8)0x00 << (Q_INT32)user.length() - << (Q_INT8)0x00 << (Q_INT8)0x00 << (Q_INT8)0x00 << (Q_INT8)0x00 << (Q_INT8)0x01; + stream << (TQ_INT8)0x0d << (TQ_INT8)0x00 << (TQ_INT8)0x05 << (TQ_INT8)0x00 << (TQ_INT32)user.length() + << (TQ_INT8)0x00 << (TQ_INT8)0x00 << (TQ_INT8)0x00 << (TQ_INT8)0x00 << (TQ_INT8)0x01; socket->writeBlock( ar.data(), ar.size() ); socket->writeBlock( user.local8Bit(), user.length() ); } @@ -689,8 +689,8 @@ void WebcamTask::transmitWebcamImage() socket->enableWrite( false ); TQByteArray buffer; TQDataStream stream( buffer, IO_WriteOnly ); - stream << (Q_INT8)0x0d << (Q_INT8)0x00 << (Q_INT8)0x05 << (Q_INT8)0x00 << (Q_INT32)pictureBuffer.size() - << (Q_INT8)0x02 << (Q_INT32)timestamp++; + stream << (TQ_INT8)0x0d << (TQ_INT8)0x00 << (TQ_INT8)0x05 << (TQ_INT8)0x00 << (TQ_INT32)pictureBuffer.size() + << (TQ_INT8)0x02 << (TQ_INT32)timestamp++; socket->writeBlock( buffer.data(), buffer.size() ); if( pictureBuffer.size() ) socket->writeBlock( pictureBuffer.data(), pictureBuffer.size() ); |