diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:52:55 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:52:55 +0000 |
commit | 5f5ee2367157176ed223b86343eb0a9e4022e020 (patch) | |
tree | 6a9c87f14ee38e90eff3c77c784f14e4f38fd5a1 /khexedit/lib/codecs | |
parent | 4facf42feec57b22dcf46badc115ad6c5b5cc512 (diff) | |
download | tdeutils-5f5ee2367157176ed223b86343eb0a9e4022e020.tar.gz tdeutils-5f5ee2367157176ed223b86343eb0a9e4022e020.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1157653 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'khexedit/lib/codecs')
-rw-r--r-- | khexedit/lib/codecs/kbinarybytecodec.cpp | 4 | ||||
-rw-r--r-- | khexedit/lib/codecs/kbinarybytecodec.h | 4 | ||||
-rw-r--r-- | khexedit/lib/codecs/kbytecodec.cpp | 4 | ||||
-rw-r--r-- | khexedit/lib/codecs/kcharcodec.cpp | 6 | ||||
-rw-r--r-- | khexedit/lib/codecs/kdecimalbytecodec.cpp | 4 | ||||
-rw-r--r-- | khexedit/lib/codecs/kdecimalbytecodec.h | 4 | ||||
-rw-r--r-- | khexedit/lib/codecs/kebcdic1047charcodec.cpp | 10 | ||||
-rw-r--r-- | khexedit/lib/codecs/kebcdic1047charcodec.h | 6 | ||||
-rw-r--r-- | khexedit/lib/codecs/khexadecimalbytecodec.cpp | 8 | ||||
-rw-r--r-- | khexedit/lib/codecs/khexadecimalbytecodec.h | 6 | ||||
-rw-r--r-- | khexedit/lib/codecs/koctalbytecodec.cpp | 4 | ||||
-rw-r--r-- | khexedit/lib/codecs/koctalbytecodec.h | 4 | ||||
-rw-r--r-- | khexedit/lib/codecs/ktextcharcodec.cpp | 52 | ||||
-rw-r--r-- | khexedit/lib/codecs/ktextcharcodec.h | 20 |
14 files changed, 68 insertions, 68 deletions
diff --git a/khexedit/lib/codecs/kbinarybytecodec.cpp b/khexedit/lib/codecs/kbinarybytecodec.cpp index d665a05..a49a460 100644 --- a/khexedit/lib/codecs/kbinarybytecodec.cpp +++ b/khexedit/lib/codecs/kbinarybytecodec.cpp @@ -21,13 +21,13 @@ using namespace KHE; -void KBinaryByteCodec::encode( QString &Digits, unsigned int Pos, const unsigned char Char ) const +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'; } -void KBinaryByteCodec::encodeShort( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KBinaryByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char M = 1<<7; // find first set bit diff --git a/khexedit/lib/codecs/kbinarybytecodec.h b/khexedit/lib/codecs/kbinarybytecodec.h index d0354fa..631fa74 100644 --- a/khexedit/lib/codecs/kbinarybytecodec.h +++ b/khexedit/lib/codecs/kbinarybytecodec.h @@ -41,9 +41,9 @@ class KBinaryByteCodec : public KByteCodec virtual unsigned char digitsFilledLimit() const { return 128; } /** encodes the Char and writes the result to */ - virtual void encode( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ - virtual void encodeShort( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encodeShort( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ virtual bool appendDigit( unsigned char *Byte, const unsigned char Digit ) const; /** */ diff --git a/khexedit/lib/codecs/kbytecodec.cpp b/khexedit/lib/codecs/kbytecodec.cpp index dc5137f..f4847ba 100644 --- a/khexedit/lib/codecs/kbytecodec.cpp +++ b/khexedit/lib/codecs/kbytecodec.cpp @@ -38,9 +38,9 @@ KByteCodec *KByteCodec::createCodec( KCoding C ) return Codec; } -unsigned int KByteCodec::decode( unsigned char *Char, const QString &Digits, uint Pos ) const +unsigned int KByteCodec::decode( unsigned char *Char, const TQString &Digits, uint Pos ) const { - //kdDebug() << QString("KByteCodec::decode(%1,%2)").arg(Digits).arg(Pos) << endl; + //kdDebug() << TQString("KByteCodec::decode(%1,%2)").arg(Digits).arg(Pos) << endl; const uint P = Pos; // remove leading 0s diff --git a/khexedit/lib/codecs/kcharcodec.cpp b/khexedit/lib/codecs/kcharcodec.cpp index 5a58320..1aab79b 100644 --- a/khexedit/lib/codecs/kcharcodec.cpp +++ b/khexedit/lib/codecs/kcharcodec.cpp @@ -23,9 +23,9 @@ using namespace KHE; -QStringList KCharCodec::CodecNames; +TQStringList KCharCodec::CodecNames; -const QStringList &KCharCodec::codecNames() +const TQStringList &KCharCodec::codecNames() { // first call? if( CodecNames.isEmpty() ) @@ -38,7 +38,7 @@ const QStringList &KCharCodec::codecNames() } -KCharCodec *KCharCodec::createCodec( const QString &Name ) +KCharCodec *KCharCodec::createCodec( const TQString &Name ) { KCharCodec *Codec = 0; diff --git a/khexedit/lib/codecs/kdecimalbytecodec.cpp b/khexedit/lib/codecs/kdecimalbytecodec.cpp index 9470382..c556875 100644 --- a/khexedit/lib/codecs/kdecimalbytecodec.cpp +++ b/khexedit/lib/codecs/kdecimalbytecodec.cpp @@ -21,7 +21,7 @@ using namespace KHE; -void KDecimalByteCodec::encode( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KDecimalByteCodec::encode( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char C = Char / 100; Digits.at(Pos++) = '0'+C; @@ -33,7 +33,7 @@ void KDecimalByteCodec::encode( QString &Digits, unsigned int Pos, unsigned char } -void KDecimalByteCodec::encodeShort( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KDecimalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char C; if( (C = Char / 100) ) diff --git a/khexedit/lib/codecs/kdecimalbytecodec.h b/khexedit/lib/codecs/kdecimalbytecodec.h index 31f61d0..b91e6a8 100644 --- a/khexedit/lib/codecs/kdecimalbytecodec.h +++ b/khexedit/lib/codecs/kdecimalbytecodec.h @@ -41,9 +41,9 @@ class KDecimalByteCodec : public KByteCodec virtual unsigned char digitsFilledLimit() const { return 26; } /** encodes the Char and writes the result to */ - virtual void encode( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ - virtual void encodeShort( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encodeShort( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ virtual bool appendDigit( unsigned char *Byte, const unsigned char Digit ) const; /** */ diff --git a/khexedit/lib/codecs/kebcdic1047charcodec.cpp b/khexedit/lib/codecs/kebcdic1047charcodec.cpp index f26da37..d1002c3 100644 --- a/khexedit/lib/codecs/kebcdic1047charcodec.cpp +++ b/khexedit/lib/codecs/kebcdic1047charcodec.cpp @@ -96,7 +96,7 @@ static unsigned char EBCDICChars[256] = static const char KEBCDIC1047CharCodecName[] = "EBCDIC 1047"; -bool KEBCDIC1047CharCodec::encode( char *D, const QChar &C ) const +bool KEBCDIC1047CharCodec::encode( char *D, const TQChar &C ) const { int I = C.unicode(); // not in range? @@ -109,16 +109,16 @@ bool KEBCDIC1047CharCodec::encode( char *D, const QChar &C ) const KHEChar KEBCDIC1047CharCodec::decode( char Byte ) const { - return QChar(UnicodeChars[(unsigned char)Byte]); + return TQChar(UnicodeChars[(unsigned char)Byte]); } -const QString& KEBCDIC1047CharCodec::name() const +const TQString& KEBCDIC1047CharCodec::name() const { return codecName(); } -const QString& KEBCDIC1047CharCodec::codecName() +const TQString& KEBCDIC1047CharCodec::codecName() { - static const QString Name( QString::fromLatin1(KEBCDIC1047CharCodecName) ); + static const TQString Name( TQString::fromLatin1(KEBCDIC1047CharCodecName) ); return Name; } diff --git a/khexedit/lib/codecs/kebcdic1047charcodec.h b/khexedit/lib/codecs/kebcdic1047charcodec.h index 7c30956..8ac1d43 100644 --- a/khexedit/lib/codecs/kebcdic1047charcodec.h +++ b/khexedit/lib/codecs/kebcdic1047charcodec.h @@ -32,12 +32,12 @@ class KEBCDIC1047CharCodec : public KCharCodec public: // KCharCodec API virtual KHEChar decode( char Byte ) const; - virtual bool encode( char *D, const QChar &C ) const; - virtual const QString& name() const; + virtual bool encode( char *D, const TQChar &C ) const; + virtual const TQString& name() const; public: static KEBCDIC1047CharCodec *create(); - static const QString& codecName(); + static const TQString& codecName(); }; diff --git a/khexedit/lib/codecs/khexadecimalbytecodec.cpp b/khexedit/lib/codecs/khexadecimalbytecodec.cpp index 7072464..596fd24 100644 --- a/khexedit/lib/codecs/khexadecimalbytecodec.cpp +++ b/khexedit/lib/codecs/khexadecimalbytecodec.cpp @@ -21,9 +21,9 @@ using namespace KHE; -static const QChar BigDigit[16] = +static const TQChar BigDigit[16] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; -static const QChar SmallDigit[16] = +static const TQChar SmallDigit[16] = { '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f' }; @@ -39,13 +39,13 @@ bool KHexadecimalByteCodec::setSmallDigits( bool S ) bool KHexadecimalByteCodec::smallDigits() const { return Digit != BigDigit; } -void KHexadecimalByteCodec::encode( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KHexadecimalByteCodec::encode( TQString &Digits, unsigned int Pos, unsigned char Char ) const { Digits.at(Pos++) = Digit[Char>>4]; Digits.at(Pos) = Digit[Char&0x0F]; } -void KHexadecimalByteCodec::encodeShort( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KHexadecimalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char C; if( (C = (Char>>4)) ) diff --git a/khexedit/lib/codecs/khexadecimalbytecodec.h b/khexedit/lib/codecs/khexadecimalbytecodec.h index 9bb1969..88b2f83 100644 --- a/khexedit/lib/codecs/khexadecimalbytecodec.h +++ b/khexedit/lib/codecs/khexadecimalbytecodec.h @@ -48,9 +48,9 @@ class KHexadecimalByteCodec : public KByteCodec virtual unsigned char digitsFilledLimit() const { return 16; } /** encodes the Char and writes the result to */ - virtual void encode( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ - virtual void encodeShort( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encodeShort( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ virtual bool appendDigit( unsigned char *Byte, const unsigned char Digit ) const; /** */ @@ -61,7 +61,7 @@ class KHexadecimalByteCodec : public KByteCodec virtual bool turnToValue( unsigned char *Digit ) const; protected: - const QChar* Digit; + const TQChar* Digit; }; } diff --git a/khexedit/lib/codecs/koctalbytecodec.cpp b/khexedit/lib/codecs/koctalbytecodec.cpp index 1167941..44c7952 100644 --- a/khexedit/lib/codecs/koctalbytecodec.cpp +++ b/khexedit/lib/codecs/koctalbytecodec.cpp @@ -21,7 +21,7 @@ using namespace KHE; -void KOctalByteCodec::encode( QString &Digits, unsigned int Pos, unsigned char Char ) const +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); @@ -29,7 +29,7 @@ void KOctalByteCodec::encode( QString &Digits, unsigned int Pos, unsigned char C } -void KOctalByteCodec::encodeShort( QString &Digits, unsigned int Pos, unsigned char Char ) const +void KOctalByteCodec::encodeShort( TQString &Digits, unsigned int Pos, unsigned char Char ) const { unsigned char C; if( (C = (Char>>6)&0x07) ) diff --git a/khexedit/lib/codecs/koctalbytecodec.h b/khexedit/lib/codecs/koctalbytecodec.h index e05ca66..14693f3 100644 --- a/khexedit/lib/codecs/koctalbytecodec.h +++ b/khexedit/lib/codecs/koctalbytecodec.h @@ -41,9 +41,9 @@ class KOctalByteCodec : public KByteCodec virtual unsigned char digitsFilledLimit() const { return 64; } /** encodes the Char and writes the result to */ - virtual void encode( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encode( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ - virtual void encodeShort( QString &Digits, unsigned int Pos, const unsigned char Char ) const; + virtual void encodeShort( TQString &Digits, unsigned int Pos, const unsigned char Char ) const; /** */ virtual bool appendDigit( unsigned char *Byte, const unsigned char Digit ) const; /** */ diff --git a/khexedit/lib/codecs/ktextcharcodec.cpp b/khexedit/lib/codecs/ktextcharcodec.cpp index 613dedd..a9014dd 100644 --- a/khexedit/lib/codecs/ktextcharcodec.cpp +++ b/khexedit/lib/codecs/ktextcharcodec.cpp @@ -16,7 +16,7 @@ // qt specific -#include "qtextcodec.h" +#include "tqtextcodec.h" // kde specific #include <kglobal.h> #include <klocale.h> @@ -63,7 +63,7 @@ const EncodingNames[] = { //TODO: WS2 static const unsigned int NoOfEncodings = 26; -static bool is8Bit( QTextCodec *Codec ) +static bool is8Bit( TQTextCodec *Codec ) { bool Found = false; for( unsigned int i=0; i<NoOfEncodings; ++i ) @@ -77,13 +77,13 @@ static bool is8Bit( QTextCodec *Codec ) return Found; } -static QTextCodec *createLatin1() +static TQTextCodec *createLatin1() { return KGlobal::charsets()->codecForName( EncodingNames[0].Name ); } /** heuristic seems to be doomed :( -static bool is8Bit( QTextCodec *Codec ) +static bool is8Bit( TQTextCodec *Codec ) { bool Result = true; @@ -91,9 +91,9 @@ static bool is8Bit( QTextCodec *Codec ) unsigned char c[4]; c[0] = 0; c[1] = c[2] = c[3] = 230; - QString S = Codec->toUnicode( (const char*)&c,4 ); + TQString S = Codec->toUnicode( (const char*)&c,4 ); int Length = 1; - QCString CS = Codec->fromUnicode( S, Length ); + TQCString CS = Codec->fromUnicode( S, Length ); //kdDebug() << Codec->name() << " "<<Length << endl; if( Length > 0 ) Result = false; @@ -115,26 +115,26 @@ static bool is8Bit( QTextCodec *Codec ) while( c[0] < 255 ); return Result; } -const QStringList &KTextCharCodec::codecNames() +const TQStringList &KTextCharCodec::codecNames() { // first call? if( CodecNames.isEmpty() ) { - const QStringList &CharSets = KGlobal::charsets()->availableEncodingNames(); + const TQStringList &CharSets = KGlobal::charsets()->availableEncodingNames(); - for( QStringList::ConstIterator it = CharSets.begin(); it != CharSets.end(); ++it ) + for( TQStringList::ConstIterator it = CharSets.begin(); it != CharSets.end(); ++it ) { bool Found = true; - QTextCodec* Codec = KGlobal::charsets()->codecForName( *it, Found ); + TQTextCodec* Codec = KGlobal::charsets()->codecForName( *it, Found ); if( Found && is8Bit(Codec) ) - CodecNames.append( QString::fromLatin1(Codec->name()) ); + CodecNames.append( TQString::fromLatin1(Codec->name()) ); } } return CodecNames; } -QString KTextCharCodec::nameOfEncoding( KEncoding C ) +TQString KTextCharCodec::nameOfEncoding( KEncoding C ) { KTextCharCodec *Codec = 0; @@ -150,35 +150,35 @@ QString KTextCharCodec::nameOfEncoding( KEncoding C ) if( N != 0 ) { - QString CodeName = QString::fromLatin1( N ); + TQString CodeName = TQString::fromLatin1( N ); } return Codec; } */ -QStringList KTextCharCodec::CodecNames; +TQStringList KTextCharCodec::CodecNames; KTextCharCodec *KTextCharCodec::createLocalCodec() { - QTextCodec *Codec = KGlobal::locale()->codecForEncoding(); + TQTextCodec *Codec = KGlobal::locale()->codecForEncoding(); if( !is8Bit(Codec) ) Codec = createLatin1(); return new KTextCharCodec( Codec ); } -KTextCharCodec *KTextCharCodec::createCodec( const QString &CodeName ) +KTextCharCodec *KTextCharCodec::createCodec( const TQString &CodeName ) { bool Ok; - QTextCodec *Codec = KGlobal::charsets()->codecForName( CodeName, Ok ); + TQTextCodec *Codec = KGlobal::charsets()->codecForName( CodeName, Ok ); if( Ok ) Ok = is8Bit( Codec ); return Ok ? new KTextCharCodec( Codec ) : 0; } -const QStringList &KTextCharCodec::codecNames() +const TQStringList &KTextCharCodec::codecNames() { // first call? if( CodecNames.isEmpty() ) @@ -186,10 +186,10 @@ const QStringList &KTextCharCodec::codecNames() for( unsigned int i=0; i<NoOfEncodings; ++i ) { bool Found = true; - QString Name = QString::fromLatin1( EncodingNames[i].Name ); - QTextCodec* Codec = KGlobal::charsets()->codecForName( Name, Found ); + TQString Name = TQString::fromLatin1( EncodingNames[i].Name ); + TQTextCodec* Codec = KGlobal::charsets()->codecForName( Name, Found ); if( Found ) - CodecNames.append( QString::fromLatin1(Codec->name()) ); + CodecNames.append( TQString::fromLatin1(Codec->name()) ); } } @@ -197,7 +197,7 @@ const QStringList &KTextCharCodec::codecNames() } -KTextCharCodec::KTextCharCodec( QTextCodec *C ) +KTextCharCodec::KTextCharCodec( TQTextCodec *C ) : Codec( C ), Decoder( C->makeDecoder() ), Encoder( C->makeEncoder() ) @@ -209,7 +209,7 @@ KTextCharCodec::~KTextCharCodec() delete Encoder; } -bool KTextCharCodec::encode( char *D, const QChar &C ) const +bool KTextCharCodec::encode( char *D, const TQChar &C ) const { if( !Codec->canEncode(C) ) // TODO: do we really need the codec? return false; @@ -223,14 +223,14 @@ bool KTextCharCodec::encode( char *D, const QChar &C ) const KHEChar KTextCharCodec::decode( char Byte ) const { - QString S( Decoder->toUnicode(&Byte,1) ); + TQString S( Decoder->toUnicode(&Byte,1) ); return KHEChar(S.at(0)); } -const QString& KTextCharCodec::name() const +const TQString& KTextCharCodec::name() const { if( Name.isNull() ) - Name = QString::fromLatin1( Codec->name() ); + Name = TQString::fromLatin1( Codec->name() ); return Name; } diff --git a/khexedit/lib/codecs/ktextcharcodec.h b/khexedit/lib/codecs/ktextcharcodec.h index 683919c..48ca3b0 100644 --- a/khexedit/lib/codecs/ktextcharcodec.h +++ b/khexedit/lib/codecs/ktextcharcodec.h @@ -32,33 +32,33 @@ namespace KHE class KTextCharCodec : public KCharCodec { public: - static KTextCharCodec *createCodec( const QString &CodeName ); + static KTextCharCodec *createCodec( const TQString &CodeName ); static KTextCharCodec *createCodec( KEncoding C ); static KTextCharCodec *createLocalCodec(); - static const QStringList &codecNames(); + static const TQStringList &codecNames(); protected: - KTextCharCodec( QTextCodec *C ); + KTextCharCodec( TQTextCodec *C ); public: virtual ~KTextCharCodec(); public: // KCharCodec API - virtual bool encode( char *D, const QChar &C ) const; + virtual bool encode( char *D, const TQChar &C ) const; virtual KHEChar decode( char Byte ) const; - virtual const QString& name() const; + virtual const TQString& name() const; protected: - QTextCodec *Codec; + TQTextCodec *Codec; /** decodes the chars to unicode */ - QTextDecoder *Decoder; + TQTextDecoder *Decoder; /** encodes the chars from unicode */ - QTextEncoder *Encoder; + TQTextEncoder *Encoder; /** */ - mutable QString Name; + mutable TQString Name; - static QStringList CodecNames; + static TQStringList CodecNames; }; } |