summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/yahoo/libkyahoo/logintask.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/protocols/yahoo/libkyahoo/logintask.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-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/yahoo/libkyahoo/logintask.cpp')
-rw-r--r--kopete/protocols/yahoo/libkyahoo/logintask.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/kopete/protocols/yahoo/libkyahoo/logintask.cpp b/kopete/protocols/yahoo/libkyahoo/logintask.cpp
index d3b5be7b..3c3127b2 100644
--- a/kopete/protocols/yahoo/libkyahoo/logintask.cpp
+++ b/kopete/protocols/yahoo/libkyahoo/logintask.cpp
@@ -25,7 +25,7 @@
#include "ymsgtransfer.h"
#include "yahootypes.h"
#include "client.h"
-#include <qstring.h>
+#include <tqstring.h>
#include <kdebug.h>
#include <stdlib.h>
@@ -179,10 +179,10 @@ void LoginTask::sendAuthResp(YMSGTransfer* t)
{
kdDebug(YAHOO_RAW_DEBUG) ;
- QString sn = t->firstParam( 1 );
- QString seed = t->firstParam( 94 );
+ TQString sn = t->firstParam( 1 );
+ TQString seed = t->firstParam( 94 );
m_challengeString = seed;
- QString version_s = t->firstParam( 13 );
+ TQString version_s = t->firstParam( 13 );
m_sessionID = t->id();
int version = version_s.toInt();
@@ -205,23 +205,23 @@ void LoginTask::sendAuthResp(YMSGTransfer* t)
emit haveSessionID( m_sessionID );
}
-void LoginTask::sendAuthSixteenStage1(const QString& sn, const QString& seed)
+void LoginTask::sendAuthSixteenStage1(const TQString& sn, const TQString& seed)
{
- const QString YahooTokenUrl = "https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=&login=%1&passwd=%2&chal=%3";
+ const TQString YahooTokenUrl = "https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=&login=%1&passwd=%2&chal=%3";
kdDebug(YAHOO_RAW_DEBUG) << "seed:" << seed << endl;
- m_stage1Data= QString::null;
+ m_stage1Data= TQString::null;
/* construct a URL from the seed and request tokens */
- QByteArray encodedUrl;
- QString fullUrl = YahooTokenUrl.arg(sn, client()->password(), seed);
+ TQByteArray encodedUrl;
+ TQString fullUrl = YahooTokenUrl.arg(sn, client()->password(), seed);
KURL tokenUrl(fullUrl);
KIO::Job* job = KIO::get(tokenUrl, true, false);
- connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- this, SLOT(handleAuthSixteenStage1Data(KIO::Job*, const QByteArray&)));
- connect(job, SIGNAL(result(KIO::Job*)),
- this, SLOT(handleAuthSixteenStage1Result(KIO::Job*)));
+ connect(job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ this, TQT_SLOT(handleAuthSixteenStage1Data(KIO::Job*, const TQByteArray&)));
+ connect(job, TQT_SIGNAL(result(KIO::Job*)),
+ this, TQT_SLOT(handleAuthSixteenStage1Result(KIO::Job*)));
}
-void LoginTask::handleAuthSixteenStage1Data(KIO::Job* job, const QByteArray& data)
+void LoginTask::handleAuthSixteenStage1Data(KIO::Job* job, const TQByteArray& data)
{
kdDebug(YAHOO_RAW_DEBUG) << "data:" << data << endl;
m_stage1Data.append(data);
@@ -230,12 +230,12 @@ void LoginTask::handleAuthSixteenStage1Data(KIO::Job* job, const QByteArray& dat
void LoginTask::handleAuthSixteenStage1Result(KIO::Job* job)
{
int responseNumber = -1;
- QString token;
+ TQString token;
int error = job->error();
kdDebug(YAHOO_RAW_DEBUG) << "error:" << error << endl;
if (error == 0)
{
- QStringList responses = QStringList::split("\r\n", m_stage1Data);
+ TQStringList responses = TQStringList::split("\r\n", m_stage1Data);
responseNumber = responses[0].toInt();
if (responses.count() >= 3)
{
@@ -250,26 +250,26 @@ void LoginTask::handleAuthSixteenStage1Result(KIO::Job* job)
{
case -1:
/* error in the received stream */
- emit loginResponse(Yahoo::LoginSock, QString());
+ emit loginResponse(Yahoo::LoginSock, TQString());
kdDebug(YAHOO_RAW_DEBUG) << "unknown error logging in" << endl;
break;
case 1212:
/* password incorrect */
- emit loginResponse(Yahoo::LoginPasswd, QString());
+ emit loginResponse(Yahoo::LoginPasswd, TQString());
kdDebug(YAHOO_RAW_DEBUG) << "password incorrect" << endl;
break;
case 1213:
/* security lock */
- emit loginResponse(Yahoo::LoginLock, QString());
+ emit loginResponse(Yahoo::LoginLock, TQString());
break;
case 1235:
/* username does not exist */
- emit loginResponse(Yahoo::LoginUname, QString());
+ emit loginResponse(Yahoo::LoginUname, TQString());
kdDebug(YAHOO_RAW_DEBUG) << "user does not exist" << endl;
break;
case 1214:
case 1236:
- emit loginResponse(Yahoo::LoginVerify, QString());
+ emit loginResponse(Yahoo::LoginVerify, TQString());
break;
case 100: /* username or password missing */
/*FIXME handle this */
@@ -287,21 +287,21 @@ void LoginTask::handleAuthSixteenStage1Result(KIO::Job* job)
}
}
-void LoginTask::sendAuthSixteenStage2(const QString& token)
+void LoginTask::sendAuthSixteenStage2(const TQString& token)
{
- const QString YahooLoginUrl = "https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=&token=%1";
+ const TQString YahooLoginUrl = "https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=&token=%1";
kdDebug(YAHOO_RAW_DEBUG) << "token:" << token << endl;
- m_stage2Data = QString::null;
- QString fullUrl = YahooLoginUrl.arg(token);
+ m_stage2Data = TQString::null;
+ TQString fullUrl = YahooLoginUrl.arg(token);
KURL loginUrl(fullUrl);
KIO::Job* job = KIO::get(loginUrl, true, false);
- connect(job, SIGNAL(data(KIO::Job*, const QByteArray&)),
- this, SLOT(handleAuthSixteenStage2Data(KIO::Job*, const QByteArray&)));
- connect(job, SIGNAL(result(KIO::Job*)),
- this, SLOT(handleAuthSixteenStage2Result(KIO::Job*)));
+ connect(job, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)),
+ this, TQT_SLOT(handleAuthSixteenStage2Data(KIO::Job*, const TQByteArray&)));
+ connect(job, TQT_SIGNAL(result(KIO::Job*)),
+ this, TQT_SLOT(handleAuthSixteenStage2Result(KIO::Job*)));
}
-void LoginTask::handleAuthSixteenStage2Data(KIO::Job*, const QByteArray& data)
+void LoginTask::handleAuthSixteenStage2Data(KIO::Job*, const TQByteArray& data)
{
kdDebug(YAHOO_RAW_DEBUG) << "data:" << data << endl;
m_stage2Data.append(data);
@@ -309,13 +309,13 @@ void LoginTask::handleAuthSixteenStage2Data(KIO::Job*, const QByteArray& data)
void LoginTask::handleAuthSixteenStage2Result(KIO::Job* job)
{
- QString crumb;
+ TQString crumb;
int responseNumber = -1;
int error = job->error();
kdDebug(YAHOO_RAW_DEBUG) << "error:" << error << endl;
if (error == 0)
{
- QStringList responses = QStringList::split("\r\n", m_stage2Data);
+ TQStringList responses = TQStringList::split("\r\n", m_stage2Data);
kdDebug(YAHOO_RAW_DEBUG) << responses << endl;
responseNumber = responses[0].toInt();
if (responseNumber == 0)
@@ -331,10 +331,10 @@ void LoginTask::handleAuthSixteenStage2Result(KIO::Job* job)
switch(responseNumber)
{
case -1:
- emit loginResponse(Yahoo::LoginSock, QString());
+ emit loginResponse(Yahoo::LoginSock, TQString());
break;
case 100:
- emit loginResponse(Yahoo::LoginSock, QString());
+ emit loginResponse(Yahoo::LoginSock, TQString());
break;
default: /* try to login anyways */
break;
@@ -342,22 +342,22 @@ void LoginTask::handleAuthSixteenStage2Result(KIO::Job* job)
}
else
{
- QString cryptString = crumb;
+ TQString cryptString = crumb;
cryptString.append(m_challengeString);
sendAuthSixteenStage3(cryptString);
}
}
}
-void LoginTask::sendAuthSixteenStage3(const QString& cryptString)
+void LoginTask::sendAuthSixteenStage3(const TQString& cryptString)
{
kdDebug(YAHOO_RAW_DEBUG) << " with crypt string" << cryptString << endl;
- //QByteArray cryptStringHash = QCryptographicHash::hash( cryptString.toAscii(),
+ //TQByteArray cryptStringHash = QCryptographicHash::hash( cryptString.toAscii(),
// QCryptographicHash::Md5 );
//cryptStringHash = cryptStringHash.toBase64();
- QString cryptStringHash = KMD5( cryptString.ascii() ).base64Digest();
+ TQString cryptStringHash = KMD5( cryptString.ascii() ).base64Digest();
cryptStringHash = cryptStringHash.replace('+', '.');
cryptStringHash = cryptStringHash.replace('/', '_');
@@ -379,7 +379,7 @@ void LoginTask::sendAuthSixteenStage3(const QString& cryptString)
}
-void LoginTask::sendAuthResp_pre_0x0b(const QString &/*sn*/, const QString &/*seed*/)
+void LoginTask::sendAuthResp_pre_0x0b(const TQString &/*sn*/, const TQString &/*seed*/)
{
kdDebug(YAHOO_RAW_DEBUG) ;
}
@@ -392,7 +392,7 @@ void LoginTask::handleAuthResp(YMSGTransfer *t)
{
case( Yahoo::ServiceList ):
kdDebug(YAHOO_RAW_DEBUG) << "Emitting Signal" << endl;
- emit loginResponse( Yahoo::LoginOk, QString() );
+ emit loginResponse( Yahoo::LoginOk, TQString() );
break;
case( Yahoo::ServiceAuthResp ):
kdDebug(YAHOO_RAW_DEBUG) << "Emitting Signal" << endl;
@@ -415,7 +415,7 @@ void LoginTask::parseCookies( YMSGTransfer *t )
for( int i = 0; i < t->paramCount( 59 ); ++i)
{
- QString cookie;
+ TQString cookie;
cookie = t->nthParam( 59, i );
if( cookie.startsWith( "Y" ) )
{
@@ -435,27 +435,27 @@ void LoginTask::parseCookies( YMSGTransfer *t )
emit haveCookies();
}
-void LoginTask::setVerificationWord( const QString &word )
+void LoginTask::setVerificationWord( const TQString &word )
{
m_verificationWord = word;
}
-const QString& LoginTask::yCookie()
+const TQString& LoginTask::yCookie()
{
return m_yCookie;
}
-const QString& LoginTask::tCookie()
+const TQString& LoginTask::tCookie()
{
return m_tCookie;
}
-const QString& LoginTask::cCookie()
+const TQString& LoginTask::cCookie()
{
return m_cCookie;
}
-const QString& LoginTask::loginCookie()
+const TQString& LoginTask::loginCookie()
{
return m_loginCookie;
}