From a2277b6bc715464e83882b90c2a058139b8a6b54 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 23 Jun 2011 01:42:07 +0000 Subject: TQt4 port kdeutils This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1238125 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- khexedit/lib/codecs/kbinarybytecodec.cpp | 4 ++-- khexedit/lib/codecs/kbytecodec.cpp | 4 ++-- khexedit/lib/codecs/kcharcodec.cpp | 2 +- khexedit/lib/codecs/kdecimalbytecodec.cpp | 12 ++++++------ khexedit/lib/codecs/kebcdic1047charcodec.cpp | 6 +++--- khexedit/lib/codecs/khexadecimalbytecodec.cpp | 8 ++++---- khexedit/lib/codecs/koctalbytecodec.cpp | 12 ++++++------ khexedit/lib/codecs/ktextcharcodec.cpp | 14 +++++++------- khexedit/lib/codecs/ktextcharcodec.h | 4 ++-- 9 files changed, 33 insertions(+), 33 deletions(-) (limited to 'khexedit/lib/codecs') diff --git a/khexedit/lib/codecs/kbinarybytecodec.cpp b/khexedit/lib/codecs/kbinarybytecodec.cpp index a49a460..fc9fe8d 100644 --- a/khexedit/lib/codecs/kbinarybytecodec.cpp +++ b/khexedit/lib/codecs/kbinarybytecodec.cpp @@ -24,7 +24,7 @@ using namespace KHE; void KBinaryByteCodec::encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const { for( unsigned char M=1<<7; M>0; M>>=1 ) - Digits.at(Pos++) = (Char & M) ? '1' : '0'; + Digits.tqat(Pos++) = (Char & M) ? '1' : '0'; } void KBinaryByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const @@ -36,7 +36,7 @@ void KBinaryByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned break; // now set the for( ; M>0; M>>=1 ) - Digits.at(Pos++) = (Char & M) ? '1' : '0'; + Digits.tqat(Pos++) = (Char & M) ? '1' : '0'; } diff --git a/khexedit/lib/codecs/kbytecodec.cpp b/khexedit/lib/codecs/kbytecodec.cpp index f4847ba..900055e 100644 --- a/khexedit/lib/codecs/kbytecodec.cpp +++ b/khexedit/lib/codecs/kbytecodec.cpp @@ -40,7 +40,7 @@ KByteCodec *KByteCodec::createCodec( KCoding C ) unsigned int KByteCodec::decode( unsigned char *Char, const TQString &Digits, uint Pos ) const { - //kdDebug() << TQString("KByteCodec::decode(%1,%2)").arg(Digits).arg(Pos) << endl; + //kdDebug() << TQString("KByteCodec::decode(%1,%2)").tqarg(Digits).tqarg(Pos) << endl; const uint P = Pos; // remove leading 0s @@ -50,7 +50,7 @@ unsigned int KByteCodec::decode( unsigned char *Char, const TQString &Digits, ui unsigned int d = encodingWidth(); do { - if( !appendDigit(&C,Digits.at(Pos)) ) + if( !appendDigit(&C,Digits.tqat(Pos)) ) break; ++Pos; diff --git a/khexedit/lib/codecs/kcharcodec.cpp b/khexedit/lib/codecs/kcharcodec.cpp index 1aab79b..dea28c1 100644 --- a/khexedit/lib/codecs/kcharcodec.cpp +++ b/khexedit/lib/codecs/kcharcodec.cpp @@ -42,7 +42,7 @@ KCharCodec *KCharCodec::createCodec( const TQString &Name ) { KCharCodec *Codec = 0; - if( KTextCharCodec::codecNames().findIndex(Name) != -1 ) + if( KTextCharCodec::codecNames().tqfindIndex(Name) != -1 ) Codec = KTextCharCodec::createCodec( Name ); else if( KEBCDIC1047CharCodec::codecName() == Name ) Codec = KEBCDIC1047CharCodec::create(); diff --git a/khexedit/lib/codecs/kdecimalbytecodec.cpp b/khexedit/lib/codecs/kdecimalbytecodec.cpp index c556875..065eb81 100644 --- a/khexedit/lib/codecs/kdecimalbytecodec.cpp +++ b/khexedit/lib/codecs/kdecimalbytecodec.cpp @@ -24,12 +24,12 @@ using namespace KHE; void KDecimalByteCodec::encode( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char C = Char / 100; - Digits.at(Pos++) = '0'+C; + Digits.tqat(Pos++) = '0'+C; Char -= C * 100; C = Char / 10; - Digits.at(Pos++) = '0'+C; + Digits.tqat(Pos++) = '0'+C; Char -= C * 10; - Digits.at(Pos) = '0'+Char; + Digits.tqat(Pos) = '0'+Char; } @@ -38,15 +38,15 @@ void KDecimalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigne unsigned char C; if( (C = Char / 100) ) { - Digits.at(Pos++) = '0'+C; + Digits.tqat(Pos++) = '0'+C; Char -= C * 100; } if( (C = Char / 10) ) { - Digits.at(Pos++) = '0'+C; + Digits.tqat(Pos++) = '0'+C; Char -= C * 10; } - Digits.at(Pos) = '0'+Char; + Digits.tqat(Pos) = '0'+Char; } diff --git a/khexedit/lib/codecs/kebcdic1047charcodec.cpp b/khexedit/lib/codecs/kebcdic1047charcodec.cpp index d1002c3..2e91035 100644 --- a/khexedit/lib/codecs/kebcdic1047charcodec.cpp +++ b/khexedit/lib/codecs/kebcdic1047charcodec.cpp @@ -21,7 +21,7 @@ using namespace KHE; -static Q_UINT16 UnicodeChars[256] = +static TQ_UINT16 UnicodeChars[256] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x009C, 0x0009, 0x0086, 0x007F, 0x0097, 0x008D, 0x008E, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, @@ -98,7 +98,7 @@ static const char KEBCDIC1047CharCodecName[] = "EBCDIC 1047"; bool KEBCDIC1047CharCodec::encode( char *D, const TQChar &C ) const { - int I = C.unicode(); + int I = C.tqunicode(); // not in range? if( 0x00FF < I ) return false; @@ -119,6 +119,6 @@ const TQString& KEBCDIC1047CharCodec::name() const const TQString& KEBCDIC1047CharCodec::codecName() { - static const TQString Name( TQString::fromLatin1(KEBCDIC1047CharCodecName) ); + static const TQString Name( TQString::tqfromLatin1(KEBCDIC1047CharCodecName) ); return Name; } diff --git a/khexedit/lib/codecs/khexadecimalbytecodec.cpp b/khexedit/lib/codecs/khexadecimalbytecodec.cpp index 596fd24..46abdad 100644 --- a/khexedit/lib/codecs/khexadecimalbytecodec.cpp +++ b/khexedit/lib/codecs/khexadecimalbytecodec.cpp @@ -41,16 +41,16 @@ bool KHexadecimalByteCodec::smallDigits() const { return Digit != BigDigit; } void KHexadecimalByteCodec::encode( TQString &Digits, unsigned int Pos, unsigned char Char ) const { - Digits.at(Pos++) = Digit[Char>>4]; - Digits.at(Pos) = Digit[Char&0x0F]; + Digits.tqat(Pos++) = Digit[Char>>4]; + Digits.tqat(Pos) = Digit[Char&0x0F]; } void KHexadecimalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char C; if( (C = (Char>>4)) ) - Digits.at(Pos++) = Digit[C]; - Digits.at(Pos) = Digit[Char&0x0F]; + Digits.tqat(Pos++) = Digit[C]; + Digits.tqat(Pos) = Digit[Char&0x0F]; } diff --git a/khexedit/lib/codecs/koctalbytecodec.cpp b/khexedit/lib/codecs/koctalbytecodec.cpp index 44c7952..7aa156d 100644 --- a/khexedit/lib/codecs/koctalbytecodec.cpp +++ b/khexedit/lib/codecs/koctalbytecodec.cpp @@ -23,9 +23,9 @@ using namespace KHE; void KOctalByteCodec::encode( TQString &Digits, unsigned int Pos, unsigned char Char ) const { - Digits.at(Pos++) = '0'+(Char>>6); - Digits.at(Pos++) = '0'+((Char>>3)&0x07); - Digits.at(Pos) = '0'+((Char) &0x07); + Digits.tqat(Pos++) = '0'+(Char>>6); + Digits.tqat(Pos++) = '0'+((Char>>3)&0x07); + Digits.tqat(Pos) = '0'+((Char) &0x07); } @@ -33,10 +33,10 @@ void KOctalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned { unsigned char C; if( (C = (Char>>6)&0x07) ) - Digits.at(Pos++) = '0'+C; + Digits.tqat(Pos++) = '0'+C; if( (C = (Char>>3)&0x07) ) - Digits.at(Pos++) = '0'+C; - Digits.at(Pos) = '0'+((Char)&0x07); + Digits.tqat(Pos++) = '0'+C; + Digits.tqat(Pos) = '0'+((Char)&0x07); } diff --git a/khexedit/lib/codecs/ktextcharcodec.cpp b/khexedit/lib/codecs/ktextcharcodec.cpp index a9014dd..f5bcc65 100644 --- a/khexedit/lib/codecs/ktextcharcodec.cpp +++ b/khexedit/lib/codecs/ktextcharcodec.cpp @@ -27,7 +27,7 @@ using namespace KHE; -static const char QTextCodecWhiteSpace = 63; +static const char TQTextCodecWhiteSpace = 63; static struct KEncodingNames { KEncoding Encoding; @@ -106,7 +106,7 @@ static bool is8Bit( TQTextCodec *Codec ) Length = 1; CS = Codec->fromUnicode( S, Length ); //kdDebug() << Codec->name() << " "<"<codecForName( *it, Found ); if( Found && is8Bit(Codec) ) - CodecNames.append( TQString::fromLatin1(Codec->name()) ); + CodecNames.append( TQString::tqfromLatin1(Codec->name()) ); } } @@ -150,7 +150,7 @@ TQString KTextCharCodec::nameOfEncoding( KEncoding C ) if( N != 0 ) { - TQString CodeName = TQString::fromLatin1( N ); + TQString CodeName = TQString::tqfromLatin1( N ); } return Codec; } @@ -186,10 +186,10 @@ const TQStringList &KTextCharCodec::codecNames() for( unsigned int i=0; icodecForName( Name, Found ); if( Found ) - CodecNames.append( TQString::fromLatin1(Codec->name()) ); + CodecNames.append( TQString::tqfromLatin1(Codec->name()) ); } } @@ -231,6 +231,6 @@ KHEChar KTextCharCodec::decode( char Byte ) const const TQString& KTextCharCodec::name() const { if( Name.isNull() ) - Name = TQString::fromLatin1( Codec->name() ); + Name = TQString::tqfromLatin1( Codec->name() ); return Name; } diff --git a/khexedit/lib/codecs/ktextcharcodec.h b/khexedit/lib/codecs/ktextcharcodec.h index 8d834ea..05a40ab 100644 --- a/khexedit/lib/codecs/ktextcharcodec.h +++ b/khexedit/lib/codecs/ktextcharcodec.h @@ -51,9 +51,9 @@ class KTextCharCodec : public KCharCodec protected: TQTextCodec *Codec; - /** decodes the chars to unicode */ + /** decodes the chars to tqunicode */ TQTextDecoder *Decoder; - /** encodes the chars from unicode */ + /** encodes the chars from tqunicode */ TQTextEncoder *Encoder; /** */ mutable TQString Name; -- cgit v1.2.1