From 47c8a359c5276062c4bc17f0e82410f29081b502 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:48:06 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../smpppdcs/libsmpppdclient/smpppdunsettled.cpp | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp') diff --git a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp index 7ed5f516..3d1f8a79 100644 --- a/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp +++ b/kopete/plugins/smpppdcs/libsmpppdclient/smpppdunsettled.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include @@ -41,12 +41,12 @@ Unsettled * Unsettled::instance() { return m_instance; } -bool Unsettled::connect(Client * client, const QString& server, uint port) { +bool Unsettled::connect(Client * client, const TQString& server, uint port) { if(!socket(client) || socket(client)->state() != KNetwork::KStreamSocket::Connected || socket(client)->state() != KNetwork::KStreamSocket::Connecting) { - QString resolvedServer = server; + TQString resolvedServer = server; changeState(client, Ready::instance()); disconnect(client); @@ -58,7 +58,7 @@ bool Unsettled::connect(Client * client, const QString& server, uint port) { if(resolver.wait(500)) { KNetwork::KResolverResults results = resolver.results(); if(!results.empty()) { - QString ip = results[0].address().asInet().ipAddress().toString(); + TQString ip = results[0].address().asInet().ipAddress().toString(); kdDebug(14312) << k_funcinfo << "Found IP-Address for " << server << ": " << ip << endl; resolvedServer = ip; } else { @@ -70,7 +70,7 @@ bool Unsettled::connect(Client * client, const QString& server, uint port) { return false; } - setSocket(client, new KNetwork::KStreamSocket(resolvedServer, QString::number(port))); + setSocket(client, new KNetwork::KStreamSocket(resolvedServer, TQString::number(port))); socket(client)->setBlocking(TRUE); if(!socket(client)->connect()) { @@ -78,25 +78,25 @@ bool Unsettled::connect(Client * client, const QString& server, uint port) { } else { kdDebug(14312) << k_funcinfo << "Successfully connected to smpppd \"" << server << ":" << port << "\"" << endl; - static QString verRex = "^SuSE Meta pppd \\(smpppd\\), Version (.*)$"; - static QString clgRex = "^challenge = (.*)$"; + static TQString verRex = "^SuSE Meta pppd \\(smpppd\\), Version (.*)$"; + static TQString clgRex = "^challenge = (.*)$"; - QRegExp ver(verRex); - QRegExp clg(clgRex); + TQRegExp ver(verRex); + TQRegExp clg(clgRex); - QString response = read(client)[0]; + TQString response = read(client)[0]; - if(response != QString::null && + if(response != TQString::null && ver.exactMatch(response)) { setServerID(client, response); setServerVersion(client, ver.cap(1)); changeState(client, Ready::instance()); return true; - } else if(response != QString::null && + } else if(response != TQString::null && clg.exactMatch(response)) { - if(password(client) != QString::null) { + if(password(client) != TQString::null) { // we are challenged, ok, respond - write(client, QString("response = %1\n").arg(make_response(clg.cap(1).stripWhiteSpace(), password(client))).latin1()); + write(client, TQString("response = %1\n").arg(make_response(clg.cap(1).stripWhiteSpace(), password(client))).latin1()); response = read(client)[0]; if(ver.exactMatch(response)) { setServerID(client, response); @@ -119,7 +119,7 @@ bool Unsettled::connect(Client * client, const QString& server, uint port) { return false; } -QString Unsettled::make_response(const QString& chex, const QString& password) const { +TQString Unsettled::make_response(const TQString& chex, const TQString& password) const { int size = chex.length (); if (size & 1) @@ -127,9 +127,9 @@ QString Unsettled::make_response(const QString& chex, const QString& password) c size >>= 1; // convert challenge from hex to bin - QString cbin; + TQString cbin; for (int i = 0; i < size; i++) { - QString tmp = chex.mid (2 * i, 2); + TQString tmp = chex.mid (2 * i, 2); cbin.append ((char) strtol (tmp.ascii (), 0, 16)); } @@ -142,7 +142,7 @@ QString Unsettled::make_response(const QString& chex, const QString& password) c MD5_Final (rbin, &md5); // convert response from bin to hex - QString rhex; + TQString rhex; for (int i = 0; i < MD5_DIGEST_LENGTH; i++) { char buffer[3]; snprintf (buffer, 3, "%02x", rbin[i]); -- cgit v1.2.1