SVN commit 643757 by dmacvicar: QIODevice and Q_UINT* ports M +2 -2 connector.cpp M +3 -3 connector.h M +1 -1 coreprotocol.cpp M +3 -3 inputprotocolbase.cpp M +1 -1 inputprotocolbase.h M +1 -1 modifyyabtask.cpp M +3 -3 oscartypes.h M +3 -3 sendfiletask.cpp M +1 -1 sendpicturetask.cpp M +12 -12 webcamtask.cpp M +2 -2 webcamtask.h M +2 -2 yahooclientstream.cpp M +2 -2 yahooclientstream.h M +1 -1 yahooconnector.cpp M +2 -2 yahooconnector.h M +3 -3 yahootypes.h M +11 -11 ymsgtransfer.cpp --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/connector.cpp #643756:643757 @@ -40,7 +40,7 @@ return addr; } -Q_UINT16 Connector::peerPort() const +quint16 Connector::peerPort() const { return port; } @@ -52,7 +52,7 @@ port = 0; } -void Connector::setPeerAddress(const QHostAddress &_addr, Q_UINT16 _port) +void Connector::setPeerAddress(const QHostAddress &_addr, quint16 _port) { haveaddr = true; addr = _addr; --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/connector.h #643756:643757 @@ -40,7 +40,7 @@ bool havePeerAddress() const; QHostAddress peerAddress() const; - Q_UINT16 peerPort() const; + quint16 peerPort() const; signals: void connected(); @@ -48,12 +48,12 @@ protected: void setPeerAddressNone(); - void setPeerAddress(const QHostAddress &addr, Q_UINT16 port); + void setPeerAddress(const QHostAddress &addr, quint16 port); private: bool haveaddr; QHostAddress addr; - Q_UINT16 port; + quint16 port; }; #endif --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/coreprotocol.cpp #643756:643757 @@ -133,7 +133,7 @@ YMSGTransfer *yt = (YMSGTransfer *) outgoing; QByteArray bytesOut = yt->serialize(); - //QTextStream dout( bytesOut, IO_WriteOnly ); + //QTextStream dout( bytesOut, QIODevice::WriteOnly ); //dout.setEncoding( QTextStream::Latin1 ); //dout.setByteOrder( QDataStream::LittleEndian ); //dout << bytesOut; --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/inputprotocolbase.cpp #643756:643757 @@ -65,11 +65,11 @@ bool InputProtocolBase::safeReadBytes( QByteArray & data, uint & len ) { // read the length of the bytes - Q_UINT32 val; + quint32 val; if ( !okToProceed() ) return false; *m_din >> val; - m_bytes += sizeof( Q_UINT32 ); + m_bytes += sizeof( quint32 ); if ( val > 1024 ) return false; //qDebug( "EventProtocol::safeReadBytes() - expecting %i bytes", val ); @@ -84,7 +84,7 @@ // the rest of the string will be filled with FF, // so look for that in the last position instead of \0 // this caused a crash - guessing that temp.length() is set to the number of bytes actually read... - // if ( (Q_UINT8)( * ( temp.data() + ( temp.length() - 1 ) ) ) == 0xFF ) + // if ( (quint8)( * ( temp.data() + ( temp.length() - 1 ) ) ) == 0xFF ) if ( temp.length() < static_cast( val - 1 ) ) { qDebug( "InputProtocol::safeReadBytes() - string broke, giving up, only got: %i bytes out of %i", temp.length(), val ); --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/inputprotocolbase.h #643756:643757 @@ -59,7 +59,7 @@ */ bool okToProceed(); /** - * read a Q_UINT32 giving the number of following bytes, then a string of that length + * read a quint32 giving the number of following bytes, then a string of that length * updates the bytes parsed counter * @return false if the string was broken or there was no data available at all */ --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/modifyyabtask.cpp #643756:643757 @@ -110,7 +110,7 @@ QByteArray buffer; QByteArray paket; - QDataStream stream( &buffer, IO_WriteOnly ); + QDataStream stream( &buffer, QIODevice::WriteOnly ); stream.writeRawData( header.toLocal8Bit(), header.length() ); stream.writeRawData( m_postData.toUtf8(), m_postData.toUtf8().size() ); --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/oscartypes.h #643756:643757 @@ -23,9 +23,9 @@ namespace Yahoo { - typedef Q_UINT8 BYTE; - typedef Q_UINT16 WORD; - typedef Q_UINT32 DWORD; + typedef quint8 BYTE; + typedef quint16 WORD; + typedef quint32 DWORD; } #endif --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/sendfiletask.cpp #643756:643757 @@ -82,9 +82,9 @@ t.setParam( 14, "" ); QByteArray buffer; QByteArray paket; - QDataStream stream( &buffer, IO_WriteOnly ); + QDataStream stream( &buffer, QIODevice::WriteOnly ); - if ( m_file.open(IO_ReadOnly ) ) + if ( m_file.open(QIODevice::ReadOnly ) ) { kDebug(YAHOO_RAW_DEBUG) << k_funcinfo << "File successfully opened. Reading..." << endl; } @@ -106,7 +106,7 @@ "Cache-Control: no-cache\r\n\r\n").arg(client()->yCookie()).arg(client()->tCookie()).arg(client()->cCookie()).arg(m_file.size()+4+paket.size()); stream.writeRawData( header.toLocal8Bit(), header.length() ); stream.writeRawData( paket.data(), paket.size() ); - stream << (Q_INT8)0x32 << (Q_INT8)0x39 << (Q_INT8)0xc0 << (Q_INT8)0x80; + stream << (qint8)0x32 << (qint8)0x39 << (qint8)0xc0 << (qint8)0x80; if( !m_socket->write( buffer ) ) { --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/sendpicturetask.cpp #643756:643757 @@ -119,7 +119,7 @@ "Cache-Control: no-cache\r\n\r\n").arg(client()->yCookie()).arg(client()->tCookie()).arg(client()->cCookie()).arg(file.size()+4+paket.size()); stream.writeRawData( header.toLocal8Bit(), header.length() ); stream.writeRawData( paket.data(), paket.size() ); - stream << (Q_INT8)0x32 << (Q_INT8)0x39 << (Q_INT8)0xc0 << (Q_INT8)0x80; + stream << (qint8)0x32 << (qint8)0x39 << (qint8)0xc0 << (qint8)0x80; stream.writeRawData( file.readAll(), file.size() ); kDebug(YAHOO_RAW_DEBUG) << k_funcinfo << "Buffersize: " << buffer.size() << endl; --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/webcamtask.cpp #643756:643757 @@ -144,7 +144,7 @@ } // 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 << (qint8)0x08 << (qint8)0x00 << (qint8)0x01 << (qint8)0x00 << (qint32)s.length(); stream.writeRawData( s.toLocal8Bit(), s.length() ); socket->write( buffer.data(), buffer.size() ); @@ -174,7 +174,7 @@ s = QString("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); // 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 << (qint8)0x08 << (qint8)0x00 << (qint8)0x01 << (qint8)0x00 << (qint32)s.length(); } else { @@ -184,8 +184,8 @@ s = QString("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()); // 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 << (qint8)0x0d << (qint8)0x00 << (qint8)0x05 << (qint8)0x00 << (qint32)s.length() + << (qint8)0x01 << (qint8)0x00 << (qint8)0x00 << (qint8)0x00 << (qint8)0x01; } socket->write( buffer.data(), buffer.size() ); socket->write( s.toLocal8Bit(), s.length() ); @@ -236,12 +236,12 @@ KStreamSocket *newSocket; switch( (const char)data[2] ) { - case (Q_INT8)0x06: + case (qint8)0x06: emit webcamNotAvailable(socketMap[socket].sender); break; - case (Q_INT8)0x04: - case (Q_INT8)0x07: - while( (const char)data[i] != (Q_INT8)0x00 ) + case (qint8)0x04: + case (qint8)0x07: + while( (const char)data[i] != (qint8)0x00 ) server += data[i++]; kDebug(YAHOO_RAW_DEBUG) << k_funcinfo << "Server:" << server << endl; if( server.isEmpty() ) @@ -575,8 +575,8 @@ QDataStream stream( &ar, QIODevice::WriteOnly ); QString user = QString("u=%1").arg(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 << (qint8)0x0d << (qint8)0x00 << (qint8)0x05 << (qint8)0x00 << (qint32)user.length() + << (qint8)0x00 << (qint8)0x00 << (qint8)0x00 << (qint8)0x00 << (qint8)0x01; socket->write( ar.data(), ar.size() ); socket->write( user.toLocal8Bit(), user.length() ); } @@ -683,8 +683,8 @@ socket->enableWrite( false ); QByteArray buffer; QDataStream stream( &buffer, QIODevice::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 << (qint8)0x0d << (qint8)0x00 << (qint8)0x05 << (qint8)0x00 << (qint32)pictureBuffer.size() + << (qint8)0x02 << (qint32)timestamp++; socket->write( buffer.data(), buffer.size() ); if( pictureBuffer.size() ) socket->write( pictureBuffer.data(), pictureBuffer.size() ); --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/webcamtask.h #643756:643757 @@ -43,8 +43,8 @@ PacketType type; Direction direction; uchar reason; - Q_INT32 dataLength; - Q_INT32 timestamp; + qint32 dataLength; + qint32 timestamp; bool headerRead; QBuffer *buffer; }; --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/yahooclientstream.cpp #643756:643757 @@ -79,7 +79,7 @@ bool doAuth; //send the initial login sequences to get the cookie bool haveLocalAddr; QHostAddress localAddr; - Q_UINT16 localPort; + quint16 localPort; bool doBinding; Connector *conn; @@ -203,7 +203,7 @@ d->noopTimer.start(d->noop_time); } -void ClientStream::setLocalAddr(const QHostAddress &addr, Q_UINT16 port) +void ClientStream::setLocalAddr(const QHostAddress &addr, quint16 port) { d->haveLocalAddr = true; d->localAddr = addr; --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/yahooclientstream.h #643756:643757 @@ -86,7 +86,7 @@ void setUsername(const QString &s); void setPassword(const QString &s); - void setLocalAddr(const QHostAddress &addr, Q_UINT16 port); + void setLocalAddr(const QHostAddress &addr, quint16 port); void close(); @@ -155,7 +155,7 @@ /** * convert internal method representation to wire */ - static char* encode_method(Q_UINT8 method); + static char* encode_method(quint8 method); }; #endif --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/yahooconnector.cpp #643756:643757 @@ -97,7 +97,7 @@ mByteStream->close (); } -void KNetworkConnector::setOptHostPort( const QString &host, Q_UINT16 port ) +void KNetworkConnector::setOptHostPort( const QString &host, quint16 port ) { kDebug ( YAHOO_RAW_DEBUG ) << k_funcinfo << "Manually specifying host " << host << " and port " << port << endl; --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/yahooconnector.h #643756:643757 @@ -46,7 +46,7 @@ virtual ByteStream *stream() const; virtual void done(); - void setOptHostPort( const QString &host, Q_UINT16 port ); + void setOptHostPort( const QString &host, quint16 port ); int errorCode(); @@ -56,7 +56,7 @@ private: QString mHost; - Q_UINT16 mPort; + quint16 mPort; int mErrorCode; KNetworkByteStream *mByteStream; --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/yahootypes.h #643756:643757 @@ -167,9 +167,9 @@ Picture = 2 }; - typedef Q_UINT8 BYTE; - typedef Q_UINT16 WORD; - typedef Q_UINT32 DWORD; + typedef quint8 BYTE; + typedef quint16 WORD; + typedef quint32 DWORD; struct ChatRoom { QString name; --- trunk/KDE/kdenetwork/kopete/protocols/yahoo/libkyahoo/ymsgtransfer.cpp #643756:643757 @@ -222,27 +222,27 @@ QByteArray buffer; QDataStream stream( &buffer, QIODevice::WriteOnly ); - stream << (Q_INT8)'Y' << (Q_INT8)'M' << (Q_INT8)'S' << (Q_INT8)'G'; + stream << (qint8)'Y' << (qint8)'M' << (qint8)'S' << (qint8)'G'; if( d->service == Yahoo::ServicePictureUpload ) - stream << (Q_INT16)0x0f00; + stream << (qint16)0x0f00; else - stream << (Q_INT16)0x000f; - stream << (Q_INT16)0x0000; + stream << (qint16)0x000f; + stream << (qint16)0x0000; if( d->service == Yahoo::ServicePictureUpload || d->service == Yahoo::ServiceFileTransfer ) - stream << (Q_INT16)(length()+4); + stream << (qint16)(length()+4); else - stream << (Q_INT16)length(); - stream << (Q_INT16)d->service; - stream << (Q_INT32)d->status; - stream << (Q_INT32)d->id; + stream << (qint16)length(); + stream << (qint16)d->service; + stream << (qint32)d->status; + stream << (qint32)d->id; for (ParamList::ConstIterator it = d->data.begin(); it != d->data.end(); ++it) { kDebug(YAHOO_RAW_DEBUG) << k_funcinfo << " Serializing key " << (*it).first << " value " << (*it).second << endl; stream.writeRawData ( QString::number( (*it).first ).toLocal8Bit(), QString::number( (*it).first ).length() ); - stream << (Q_INT8)0xc0 << (Q_INT8)0x80; + stream << (qint8)0xc0 << (qint8)0x80; stream.writeRawData( (*it).second, (*it).second.length() ); - stream << (Q_INT8)0xc0 << (Q_INT8)0x80; + stream << (qint8)0xc0 << (qint8)0x80; } kDebug(YAHOO_RAW_DEBUG) << k_funcinfo << " pos=" << pos << " (packet size)" << buffer << endl; return buffer;