diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kioslaves/imap4/rfcdecoder.cc | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kioslaves/imap4/rfcdecoder.cc')
-rw-r--r-- | kioslaves/imap4/rfcdecoder.cc | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/kioslaves/imap4/rfcdecoder.cc b/kioslaves/imap4/rfcdecoder.cc index 0e2bc9f73..0aa237d6b 100644 --- a/kioslaves/imap4/rfcdecoder.cc +++ b/kioslaves/imap4/rfcdecoder.cc @@ -28,9 +28,9 @@ #include <stdio.h> #include <stdlib.h> -#include <qtextcodec.h> -#include <qbuffer.h> -#include <qregexp.h> +#include <tqtextcodec.h> +#include <tqbuffer.h> +#include <tqregexp.h> #include <kmdcodec.h> // This part taken from rfc 2192 IMAP URL Scheme. C. Newman. September 1997. @@ -52,14 +52,14 @@ static unsigned char base64chars[] = /* Convert an IMAP mailbox to a Unicode path */ -QString rfcDecoder::fromIMAP (const QString & inSrc) +TQString rfcDecoder::fromIMAP (const TQString & inSrc) { unsigned char c, i, bitcount; unsigned long ucs4, utf16, bitbuf; unsigned char base64[256], utf8[6]; unsigned long srcPtr = 0; - QCString dst; - QCString src = inSrc.ascii (); + TQCString dst; + TQCString src = inSrc.ascii (); uint srcLen = inSrc.length(); /* initialize modified base64 decoding table */ @@ -151,14 +151,14 @@ QString rfcDecoder::fromIMAP (const QString & inSrc) ++srcPtr; } } - return QString::fromUtf8 (dst.data ()); + return TQString::fromUtf8 (dst.data ()); } /* replace " with \" and \ with \\ " and \ characters */ -QString rfcDecoder::quoteIMAP(const QString &src) +TQString rfcDecoder::quoteIMAP(const TQString &src) { uint len = src.length(); - QString result; + TQString result; result.reserve(2 * len); for (unsigned int i = 0; i < len; i++) { @@ -172,12 +172,12 @@ QString rfcDecoder::quoteIMAP(const QString &src) /* Convert Unicode path to modified UTF-7 IMAP mailbox */ -QString rfcDecoder::toIMAP (const QString & inSrc) +TQString rfcDecoder::toIMAP (const TQString & inSrc) { unsigned int utf8pos, utf8total, c, utf7mode, bitstogo, utf16flag; unsigned long ucs4, bitbuf; - QCString src = inSrc.utf8 (); - QString dst; + TQCString src = inSrc.utf8 (); + TQString dst; ulong srcPtr = 0; utf7mode = 0; @@ -292,9 +292,9 @@ QString rfcDecoder::toIMAP (const QString & inSrc) } //----------------------------------------------------------------------------- -QString rfcDecoder::decodeQuoting(const QString &aStr) +TQString rfcDecoder::decodeQuoting(const TQString &aStr) { - QString result; + TQString result; unsigned int strLength(aStr.length()); for (unsigned int i = 0; i < strLength ; i++) { @@ -305,46 +305,46 @@ QString rfcDecoder::decodeQuoting(const QString &aStr) } //----------------------------------------------------------------------------- -QTextCodec * -rfcDecoder::codecForName (const QString & _str) +TQTextCodec * +rfcDecoder::codecForName (const TQString & _str) { if (_str.isEmpty ()) return NULL; - return QTextCodec::codecForName (_str.lower (). + return TQTextCodec::codecForName (_str.lower (). replace ("windows", "cp").latin1 ()); } //----------------------------------------------------------------------------- const QString -rfcDecoder::decodeRFC2047String (const QString & _str) +rfcDecoder::decodeRFC2047String (const TQString & _str) { - QString throw_away; + TQString throw_away; return decodeRFC2047String (_str, throw_away); } //----------------------------------------------------------------------------- const QString -rfcDecoder::decodeRFC2047String (const QString & _str, QString & charset) +rfcDecoder::decodeRFC2047String (const TQString & _str, TQString & charset) { - QString throw_away; + TQString throw_away; return decodeRFC2047String (_str, charset, throw_away); } //----------------------------------------------------------------------------- const QString -rfcDecoder::decodeRFC2047String (const QString & _str, QString & charset, - QString & language) +rfcDecoder::decodeRFC2047String (const TQString & _str, TQString & charset, + TQString & language) { //do we have a rfc string if (_str.find("=?") < 0) return _str; - QCString aStr = _str.ascii (); // QString.length() means Unicode chars - QCString result; + TQCString aStr = _str.ascii (); // TQString.length() means Unicode chars + TQCString result; char *pos, *beg, *end, *mid = NULL; - QCString str; + TQCString str; char encoding = 0, ch; bool valid; const int maxLen = 200; @@ -370,7 +370,7 @@ rfcDecoder::decodeRFC2047String (const QString & _str, QString & charset, valid = FALSE; else { - charset = QCString (beg, i - 1); // -2 + 1 for the zero + charset = TQCString (beg, i - 1); // -2 + 1 for the zero int pt = charset.findRev('*'); if (pt != -1) { @@ -407,7 +407,7 @@ rfcDecoder::decodeRFC2047String (const QString & _str, QString & charset, { ch = *pos; *pos = '\0'; - str = QCString (mid).left ((int) (mid - pos - 1)); + str = TQCString (mid).left ((int) (mid - pos - 1)); if (encoding == 'Q') { // decode quoted printable text @@ -427,7 +427,7 @@ rfcDecoder::decodeRFC2047String (const QString & _str, QString & charset, *pos = ch; int len = str.length(); for (i = 0; i < len; i++) - result += (char) (QChar) str[i]; + result += (char) (TQChar) str[i]; pos = end - 1; } @@ -443,7 +443,7 @@ rfcDecoder::decodeRFC2047String (const QString & _str, QString & charset, } if (!charset.isEmpty ()) { - QTextCodec *aCodec = codecForName (charset.ascii ()); + TQTextCodec *aCodec = codecForName (charset.ascii ()); if (aCodec) { // kdDebug(7116) << "Codec is " << aCodec->name() << endl; @@ -458,7 +458,7 @@ rfcDecoder::decodeRFC2047String (const QString & _str, QString & charset, const char especials[17] = "()<>@,;:\"/[]?.= "; const QString -rfcDecoder::encodeRFC2047String (const QString & _str) +rfcDecoder::encodeRFC2047String (const TQString & _str) { if (_str.isEmpty ()) return _str; @@ -468,7 +468,7 @@ rfcDecoder::encodeRFC2047String (const QString & _str) int rptr = 0; // My stats show this number results in 12 resize() out of 73,000 int resultLen = 3 * _str.length() / 2; - QCString result(resultLen); + TQCString result(resultLen); while (*latin) { @@ -572,7 +572,7 @@ rfcDecoder::encodeRFC2047String (const QString & _str) //----------------------------------------------------------------------------- const QString -rfcDecoder::encodeRFC2231String (const QString & _str) +rfcDecoder::encodeRFC2231String (const TQString & _str) { if (_str.isEmpty ()) return _str; @@ -593,7 +593,7 @@ rfcDecoder::encodeRFC2231String (const QString & _str) free(latin); return _str.ascii (); } - QCString result; + TQCString result; l = latin; while (*l) { @@ -626,7 +626,7 @@ rfcDecoder::encodeRFC2231String (const QString & _str) //----------------------------------------------------------------------------- const QString -rfcDecoder::decodeRFC2231String (const QString & _str) +rfcDecoder::decodeRFC2231String (const TQString & _str) { int p = _str.find ('\''); @@ -641,9 +641,9 @@ rfcDecoder::decodeRFC2231String (const QString & _str) return _str; //first is charset or empty - QString charset = _str.left (p); - QString st = _str.mid (l + 1); - QString language = _str.mid (p + 1, l - p - 1); + TQString charset = _str.left (p); + TQString st = _str.mid (l + 1); + TQString language = _str.mid (p + 1, l - p - 1); //kdDebug(7116) << "Charset: " << charset << " Language: " << language << endl; |