diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/protocols/msn/msnchallengehandler.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/msn/msnchallengehandler.cpp')
-rw-r--r-- | kopete/protocols/msn/msnchallengehandler.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/kopete/protocols/msn/msnchallengehandler.cpp b/kopete/protocols/msn/msnchallengehandler.cpp index e0bcc987..46d4b8a0 100644 --- a/kopete/protocols/msn/msnchallengehandler.cpp +++ b/kopete/protocols/msn/msnchallengehandler.cpp @@ -19,12 +19,12 @@ #include "msnchallengehandler.h" -#include <qdatastream.h> +#include <tqdatastream.h> #include <kdebug.h> #include <kmdcodec.h> -MSNChallengeHandler::MSNChallengeHandler(const QString& productKey, const QString& productId) +MSNChallengeHandler::MSNChallengeHandler(const TQString& productKey, const TQString& productId) { m_productKey = productKey; m_productId = productId; @@ -36,17 +36,17 @@ MSNChallengeHandler::~MSNChallengeHandler() kdDebug(14140) << k_funcinfo << endl; } -QString MSNChallengeHandler::computeHash(const QString& challengeString) +TQString MSNChallengeHandler::computeHash(const TQString& challengeString) { // Step One: THe MD5 Hash. // Combine the received challenge string with the product key. KMD5 md5((challengeString + m_productKey).utf8()); - QCString digest = md5.hexDigest(); + TQCString digest = md5.hexDigest(); kdDebug(14140) << k_funcinfo << "md5: " << digest << endl; - QValueVector<Q_INT32> md5Integers(4); + TQValueVector<Q_INT32> md5Integers(4); for(Q_UINT32 i=0; i < md5Integers.count(); i++) { md5Integers[i] = hexSwap(digest.mid(i*8, 8)).toUInt(0, 16) & 0x7FFFFFFF; @@ -55,21 +55,21 @@ QString MSNChallengeHandler::computeHash(const QString& challengeString) // Step Two: Create the challenge string key - QString challengeKey = challengeString + m_productId; + TQString challengeKey = challengeString + m_productId; // Pad to multiple of 8. challengeKey = challengeKey.leftJustify(challengeKey.length() + (8 - challengeKey.length() % 8), '0'); kdDebug(14140) << k_funcinfo << "challenge key: " << challengeKey << endl; - QValueVector<Q_INT32> challengeIntegers(challengeKey.length() / 4); + TQValueVector<Q_INT32> challengeIntegers(challengeKey.length() / 4); for(Q_UINT32 i=0; i < challengeIntegers.count(); i++) { - QString sNum = challengeKey.mid(i*4, 4), sNumHex; + TQString sNum = challengeKey.mid(i*4, 4), sNumHex; // Go through the number string, determining the hex equivalent of each value // and add that to our new hex string for this number. for(uint j=0; j < sNum.length(); j++) { - sNumHex += QString::number((int)sNum[j].latin1(), 16); + sNumHex += TQString::number((int)sNum[j].latin1(), 16); } // swap because of the byte ordering issue. @@ -87,19 +87,19 @@ QString MSNChallengeHandler::computeHash(const QString& challengeString) // Step Four: Create the final hash key. - QString upper = QString::number(QString(digest.mid(0, 16)).toULongLong(0, 16)^key, 16); + TQString upper = TQString::number(TQString(digest.mid(0, 16)).toULongLong(0, 16)^key, 16); if(upper.length() % 16 != 0) upper = upper.rightJustify(upper.length() + (16 - upper.length() % 16), '0'); - QString lower = QString::number(QString(digest.mid(16, 16)).toULongLong(0, 16)^key, 16); + TQString lower = TQString::number(TQString(digest.mid(16, 16)).toULongLong(0, 16)^key, 16); if(lower.length() % 16 != 0) lower = lower.rightJustify(lower.length() + (16 - lower.length() % 16), '0'); return (upper + lower); } -Q_INT64 MSNChallengeHandler::createHashKey(const QValueVector<Q_INT32>& md5Integers, - const QValueVector<Q_INT32>& challengeIntegers) +Q_INT64 MSNChallengeHandler::createHashKey(const TQValueVector<Q_INT32>& md5Integers, + const TQValueVector<Q_INT32>& challengeIntegers) { kdDebug(14140) << k_funcinfo << "Creating 64-bit key." << endl; @@ -119,22 +119,22 @@ Q_INT64 MSNChallengeHandler::createHashKey(const QValueVector<Q_INT32>& md5Integ high = (high + md5Integers[1]) % 0x7FFFFFFF; low = (low + md5Integers[3]) % 0x7FFFFFFF; - QDataStream buffer(QByteArray(8), IO_ReadWrite); - buffer.setByteOrder(QDataStream::LittleEndian); + TQDataStream buffer(TQByteArray(8), IO_ReadWrite); + buffer.setByteOrder(TQDataStream::LittleEndian); buffer << (Q_INT32)high; buffer << (Q_INT32)low; buffer.device()->reset(); - buffer.setByteOrder(QDataStream::BigEndian); + buffer.setByteOrder(TQDataStream::BigEndian); Q_INT64 key; buffer >> key; return key; } -QString MSNChallengeHandler::hexSwap(const QString& in) +TQString MSNChallengeHandler::hexSwap(const TQString& in) { - QString sHex = in, swapped; + TQString sHex = in, swapped; while(sHex.length() > 0) { swapped = swapped + sHex.mid(sHex.length() - 2, 2); @@ -143,7 +143,7 @@ QString MSNChallengeHandler::hexSwap(const QString& in) return swapped; } -QString MSNChallengeHandler::productId() +TQString MSNChallengeHandler::productId() { return m_productId; } |