diff options
Diffstat (limited to 'kopete/protocols/groupwise/libgroupwise/responseprotocol.cpp')
-rw-r--r-- | kopete/protocols/groupwise/libgroupwise/responseprotocol.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/kopete/protocols/groupwise/libgroupwise/responseprotocol.cpp b/kopete/protocols/groupwise/libgroupwise/responseprotocol.cpp index 48ee8b88..1145583a 100644 --- a/kopete/protocols/groupwise/libgroupwise/responseprotocol.cpp +++ b/kopete/protocols/groupwise/libgroupwise/responseprotocol.cpp @@ -22,7 +22,7 @@ #include "responseprotocol.h" -ResponseProtocol::ResponseProtocol(TQObject* parent, const char* name): InputProtocolBase(parent, name) +ResponseProtocol::ResponseProtocol(TQObject* tqparent, const char* name): InputProtocolBase(tqparent, name) { } @@ -42,19 +42,19 @@ Transfer * ResponseProtocol::parse( const TQByteArray & wire, uint & bytes ) m_din.setByteOrder( TQDataStream::LittleEndian ); // check that this begins with a HTTP (is a response) - Q_UINT32 val; + TQ_UINT32 val; m_din >> val; - m_bytes += sizeof( Q_UINT32 ); + m_bytes += sizeof( TQ_UINT32 ); - Q_ASSERT( qstrncmp( (const char *)&val, "HTTP", strlen( "HTTP" ) ) == 0 ); + Q_ASSERT( tqstrncmp( (const char *)&val, "HTTP", strlen( "HTTP" ) ) == 0 ); // read rest of HTTP header and look for a 301 redirect. TQCString headerFirst; if ( !readGroupWiseLine( headerFirst ) ) return 0; // pull out the HTTP return code - int firstSpace = headerFirst.find( ' ' ); - TQString rtnField = headerFirst.mid( firstSpace, headerFirst.find( ' ', firstSpace + 1 ) ); + int firstSpace = headerFirst.tqfind( ' ' ); + TQString rtnField = headerFirst.mid( firstSpace, headerFirst.tqfind( ' ', firstSpace + 1 ) ); bool ok = true; int rtnCode; int packetState = -1; @@ -71,7 +71,7 @@ Transfer * ResponseProtocol::parse( const TQByteArray & wire, uint & bytes ) return 0; } headerRest.append( line ); - debug( TQString( "- read header line - (%1) : %2" ).arg( line.length() ).arg( line.data() ) ); + debug( TQString( "- read header line - (%1) : %2" ).tqarg( line.length() ).tqarg( line.data() ) ); } debug( "ResponseProtocol::readResponse() header finished" ); // if it's a redirect, set flag @@ -85,14 +85,14 @@ Transfer * ResponseProtocol::parse( const TQByteArray & wire, uint & bytes ) // other header processing ( 500! ) if ( ok && rtnCode == 500 ) { - debug( TQString( "- server error %1" ).arg( rtnCode ) ); + debug( TQString( "- server error %1" ).tqarg( rtnCode ) ); packetState = ServerError; m_din.unsetDevice(); return 0; } if ( ok && rtnCode == 404 ) { - debug( TQString( "- server error %1" ).arg( rtnCode ) ); + debug( TQString( "- server error %1" ).tqarg( rtnCode ) ); packetState = ServerError; m_din.unsetDevice(); return 0; @@ -116,26 +116,26 @@ Transfer * ResponseProtocol::parse( const TQByteArray & wire, uint & bytes ) int resultCode = 0; Field::FieldListIterator it; Field::FieldListIterator end = m_collatingFields.end(); - it = m_collatingFields.find( NM_A_SZ_TRANSACTION_ID ); + it = m_collatingFields.tqfind( NM_A_SZ_TRANSACTION_ID ); if ( it != end ) { Field::SingleField * sf = dynamic_cast<Field::SingleField*>( *it ); if ( sf ) { tId = sf->value().toInt(); - debug( TQString( "ResponseProtocol::readResponse() - transaction ID is %1" ).arg( tId ) ); + debug( TQString( "ResponseProtocol::readResponse() - transaction ID is %1" ).tqarg( tId ) ); m_collatingFields.remove( it ); delete sf; } } - it = m_collatingFields.find( NM_A_SZ_RESULT_CODE ); + it = m_collatingFields.tqfind( NM_A_SZ_RESULT_CODE ); if ( it != end ) { Field::SingleField * sf = dynamic_cast<Field::SingleField*>( *it ); if ( sf ) { resultCode = sf->value().toInt(); - debug( TQString( "ResponseProtocol::readResponse() - result code is %1" ).arg( resultCode ) ); + debug( TQString( "ResponseProtocol::readResponse() - result code is %1" ).tqarg( resultCode ) ); m_collatingFields.remove( it ); delete sf; } @@ -143,7 +143,7 @@ Transfer * ResponseProtocol::parse( const TQByteArray & wire, uint & bytes ) // append to inQueue if ( tId ) { - debug( TQString( "ResponseProtocol::readResponse() - setting state Available, got %1 fields in base array" ).arg(m_collatingFields.count() ) ); + debug( TQString( "ResponseProtocol::readResponse() - setting state Available, got %1 fields in base array" ).tqarg(m_collatingFields.count() ) ); packetState = Available; bytes = m_bytes; m_din.unsetDevice(); @@ -169,14 +169,14 @@ bool ResponseProtocol::readFields( int fieldCount, Field::FieldList * list ) // if we find the beginning of a new nested list, push the current list onto m_collatingFields debug( "ResponseProtocol::readFields()" ); if ( fieldCount > 0 ) - debug( TQString( "reading %1 fields" ).arg( fieldCount ) ); + debug( TQString( "reading %1 fields" ).tqarg( fieldCount ) ); Field::FieldList currentList; while ( fieldCount != 0 ) // prevents bad input data from ruining our day { // the field being read // read field - Q_UINT8 type, method; - Q_UINT32 val; + TQ_UINT8 type, method; + TQ_UINT32 val; TQCString tag; // read uint8 type if ( !okToProceed() ) @@ -185,7 +185,7 @@ bool ResponseProtocol::readFields( int fieldCount, Field::FieldList * list ) return false; } m_din >> type; - m_bytes += sizeof( Q_UINT8 ); + m_bytes += sizeof( TQ_UINT8 ); // if type is 0 SOMETHING_INVALID, we're at the end of the fields if ( type == 0 ) /*&& m_din->atEnd() )*/ { @@ -201,7 +201,7 @@ bool ResponseProtocol::readFields( int fieldCount, Field::FieldList * list ) return false; } m_din >> method; - m_bytes += sizeof( Q_UINT8 ); + m_bytes += sizeof( TQ_UINT8 ); // read tag and length if ( !safeReadBytes( tag, val ) ) { @@ -209,7 +209,7 @@ bool ResponseProtocol::readFields( int fieldCount, Field::FieldList * list ) return false; } - debug( TQString( "- type: %1, method: %2, tag: %3," ).arg( type ).arg( method ).arg( tag.data() ) ); + debug( TQString( "- type: %1, method: %2, tag: %3," ).tqarg( type ).tqarg( method ).tqarg( tag.data() ) ); // if multivalue or array if ( type == NMFIELD_TYPE_MV || type == NMFIELD_TYPE_ARRAY ) { @@ -220,10 +220,10 @@ bool ResponseProtocol::readFields( int fieldCount, Field::FieldList * list ) return false; } m_din >> val; - m_bytes += sizeof( Q_UINT32 ); + m_bytes += sizeof( TQ_UINT32 ); // create multifield - debug( TQString( " multi field containing: %1" ).arg( val ) ); + debug( TQString( " multi field containing: %1" ).tqarg( val ) ); Field::MultiField* m = new Field::MultiField( tag, method, 0, type ); currentList.append( m ); if ( !readFields( val, ¤tList) ) @@ -248,9 +248,9 @@ bool ResponseProtocol::readFields( int fieldCount, Field::FieldList * list ) m_packetState = ProtocolError; break; } - // convert to unicode - ignore the terminating NUL, because Qt<3.3.2 doesn't sanity check val. + // convert to tqunicode - ignore the terminating NUL, because TQt<3.3.2 doesn't sanity check val. TQString fieldValue = TQString::fromUtf8( rawData.data(), val - 1 ); - debug( TQString( "- utf/dn single field: %1" ).arg( fieldValue ) ); + debug( TQString( "- utf/dn single field: %1" ).tqarg( fieldValue ) ); // create singlefield Field::SingleField* s = new Field::SingleField( tag, method, 0, type, fieldValue ); currentList.append( s ); @@ -265,8 +265,8 @@ bool ResponseProtocol::readFields( int fieldCount, Field::FieldList * list ) return false; } m_din >> val; - m_bytes += sizeof( Q_UINT32 ); - debug( TQString( "- numeric field: %1" ).arg( val ) ); + m_bytes += sizeof( TQ_UINT32 ); + debug( TQString( "- numeric field: %1" ).tqarg( val ) ); Field::SingleField* s = new Field::SingleField( tag, method, 0, type, val ); currentList.append( s ); } @@ -298,13 +298,13 @@ bool ResponseProtocol::readGroupWiseLine( TQCString & line ) line = TQCString(); while ( true ) { - Q_UINT8 c; + TQ_UINT8 c; if (! okToProceed() ) return false; m_din >> c; m_bytes++; - line += TQChar(c); + line += TQChar(c).ascii(); if ( c == '\n' ) break; } |