diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2013-07-27 16:57:53 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-07-27 18:48:46 +0200 |
commit | 7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931 (patch) | |
tree | 4655c7263ca5c64d23d10167cb459dd9cb253815 /src/torclient.cpp | |
parent | 88ea2b6cd4382627fb6efca9cc54825aee881d1e (diff) | |
download | tork-7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931.tar.gz tork-7c2bc4b5ce4fc1a72868aa949e9ec49fbe2e7931.zip |
Initial TQt conversion
Diffstat (limited to 'src/torclient.cpp')
-rw-r--r-- | src/torclient.cpp | 464 |
1 files changed, 232 insertions, 232 deletions
diff --git a/src/torclient.cpp b/src/torclient.cpp index a29051a..1411076 100644 --- a/src/torclient.cpp +++ b/src/torclient.cpp @@ -20,27 +20,27 @@ ***************************************************************************/ -#include <qsocket.h> -#include <qtextstream.h> -#include <qstringlist.h> -#include <qregexp.h> +#include <ntqsocket.h> +#include <ntqtextstream.h> +#include <ntqstringlist.h> +#include <ntqregexp.h> #include "torclient.h" #include "tork.h" #include "torkconfig.h" #include "dndlistview.h" #include "functions.h" -#include <qtimer.h> +#include <ntqtimer.h> #include <klocale.h> #include <assert.h> -#include <qfile.h> +#include <ntqfile.h> #include <sys/socket.h> #include <netdb.h> #include <sys/types.h> #include <netinet/in.h> #include <arpa/inet.h> #include <kstandarddirs.h> -#include <qdir.h> +#include <ntqdir.h> #include "crypto.h" #ifndef EXTERNAL_GEOIP @@ -56,10 +56,10 @@ using namespace tk; -TorClient::TorClient( const QString &host, Q_UINT16 port ) +TorClient::TorClient( const TQString &host, TQ_UINT16 port ) { // create the socket and connect various of its signals - socket = new QSocket( this ); + socket = new TQSocket( this ); connect( socket, SIGNAL(connected()), SLOT(socketConnected()) ); connect( socket, SIGNAL(connectionClosed()), @@ -192,38 +192,38 @@ TorClient::TorClient( const QString &host, Q_UINT16 port ) void TorClient::configureServer( int orPort, int dirPort) { - sendToServer(QString("SETCONF ContactInfo=%1").arg(TorkConfig::contactInfo())) ; + sendToServer(TQString("SETCONF ContactInfo=%1").arg(TorkConfig::contactInfo())) ; - sendToServer(QString("SETCONF ClientOnly=%1").arg(TorkConfig::clientOnly())) ; + sendToServer(TQString("SETCONF ClientOnly=%1").arg(TorkConfig::clientOnly())) ; if (TorkConfig::middleMan()) - ( sendToServer(QString("SETCONF ExitPolicy=%1").arg(("\"reject *:*\"")))) ; + ( sendToServer(TQString("SETCONF ExitPolicy=%1").arg(("\"reject *:*\"")))) ; else - ( sendToServer(QString("SETCONF ExitPolicy=\"%2\"").arg( TorkConfig::exitPolicy().join(",")))); + ( sendToServer(TQString("SETCONF ExitPolicy=\"%2\"").arg( TorkConfig::exitPolicy().join(",")))); - sendToServer(QString("SETCONF NickName=%1").arg(TorkConfig::nickName())) ; + sendToServer(TQString("SETCONF NickName=%1").arg(TorkConfig::nickName())) ; if (!TorkConfig::clientOnly()){ //We send the orport configs together to avoid error messages from Tor //telling us that one cannot be set without the other. - sendToServer(QString("SETCONF ORPort=%1 " + sendToServer(TQString("SETCONF ORPort=%1 " "ORListenAddress=0.0.0.0:%2") .arg(orPort) .arg(TorkConfig::oRListenAddress())) ; //We send the dirport configs together to avoid error messages from Tor //telling us that one cannot be set without the other. - sendToServer(QString("SETCONF DIRPort=%1 " + sendToServer(TQString("SETCONF DIRPort=%1 " "DIRListenAddress=0.0.0.0:%2") .arg(dirPort) .arg(TorkConfig::dirListenAddress())) ; - sendToServer(QString("SETCONF BridgeRelay=%1").arg(TorkConfig::bridgeRelay())) ; - setBandwidth(QString("%1").arg(TorkConfig::bandwidthRate()), - QString("%1").arg(TorkConfig::bandwidthBurst()), - QString("%1").arg(TorkConfig::maxAdvertisedBandwidth())); + sendToServer(TQString("SETCONF BridgeRelay=%1").arg(TorkConfig::bridgeRelay())) ; + setBandwidth(TQString("%1").arg(TorkConfig::bandwidthRate()), + TQString("%1").arg(TorkConfig::bandwidthBurst()), + TQString("%1").arg(TorkConfig::maxAdvertisedBandwidth())); }else{ - sendToServer(QString("SETCONF ORPort= ORListenAddress=")) ; - sendToServer(QString("SETCONF DirPort= DirListenAddress=")) ; - sendToServer(QString("SETCONF BridgeRelay=")) ; + sendToServer(TQString("SETCONF ORPort= ORListenAddress=")) ; + sendToServer(TQString("SETCONF DirPort= DirListenAddress=")) ; + sendToServer(TQString("SETCONF BridgeRelay=")) ; } if (TorkConfig::clientOnly()) @@ -305,10 +305,10 @@ void TorClient::enableTransPort( bool set ) } -void TorClient::fetchServerInfo( const QString & server) +void TorClient::fetchServerInfo( const TQString & server) { - QString fp = getFPFromFPDigest(server); + TQString fp = getFPFromFPDigest(server); fp.replace("$",""); kdDebug() << fp << endl; @@ -317,11 +317,11 @@ void TorClient::fetchServerInfo( const QString & server) sendToServer("GETINFO dir/server/fp/" + fp); } -void TorClient::fetchServerInfoByNick( const QString & server) +void TorClient::fetchServerInfoByNick( const TQString & server) { - QString fp = getFPFromNickName(server); + TQString fp = getFPFromNickName(server); fp.replace("$",""); sendToServer("GETINFO dir/server/fp/" + fp); @@ -346,9 +346,9 @@ void TorClient::terminateTor() } -void TorClient::createService(const QString &dir, const QString &port) +void TorClient::createService(const TQString &dir, const TQString &port) { - sendToServer(QString("setconf hiddenservicedir=\"%1\" hiddenserviceport=\"%2\"").arg(dir).arg(port)); + sendToServer(TQString("setconf hiddenservicedir=\"%1\" hiddenserviceport=\"%2\"").arg(dir).arg(port)); } void TorClient::authenticate() @@ -362,18 +362,18 @@ void TorClient::authenticate() if (TorkConfig::cookieAuthentication()){ if (!readCookie()){ emit processQuestion("cookienotfound", - QString("Couldn't find authentication" + TQString("Couldn't find authentication" " cookie in %1/.tor!").arg(getenv("HOME"))); emit fatalError(); } }else if (!TorkConfig::hashedControlPassword().isEmpty()) - sendToServer(QString("AUTHENTICATE \"%1\"").arg(TorkConfig::hashedControlPassword())); + sendToServer(TQString("AUTHENTICATE \"%1\"").arg(TorkConfig::hashedControlPassword())); else{ sendToServer("AUTHENTICATE"); /* Lock the control port */ if (TorkConfig::generateRandomPassword()){ crypto_seed_rng(); - sendToServer(QString("setconf HashedControlPassword=16:%2") + sendToServer(TQString("setconf HashedControlPassword=16:%2") .arg(hashPassword(crypto_rand_string(16)))); } } @@ -384,25 +384,25 @@ void TorClient::authenticate() bool TorClient::readCookie() { - QString hex; + TQString hex; char hx[2]; - QStringList cookieCandidates; - cookieCandidates << QString("%1/.tor/control_auth_cookie").arg(getenv("HOME")); - cookieCandidates << QString("/var/lib/tor/control_auth_cookie"); + TQStringList cookieCandidates; + cookieCandidates << TQString("%1/.tor/control_auth_cookie").arg(getenv("HOME")); + cookieCandidates << TQString("/var/lib/tor/control_auth_cookie"); - for ( QStringList::Iterator it = cookieCandidates.begin(); it != cookieCandidates.end(); ++it ) { - QFile inf((*it)); + for ( TQStringList::Iterator it = cookieCandidates.begin(); it != cookieCandidates.end(); ++it ) { + TQFile inf((*it)); if ( inf.open(IO_ReadOnly) ) { - QByteArray array = inf.readAll(); + TQByteArray array = inf.readAll(); inf.close(); if (array.size() != 32) continue; for ( unsigned int i = 0; i < array.size(); i++ ) { sprintf(hx,"%02x",array[i]); - hex += QString(hx).right(2); + hex += TQString(hx).right(2); } - sendToServer(QString("AUTHENTICATE %1").arg(hex)); + sendToServer(TQString("AUTHENTICATE %1").arg(hex)); return true; } @@ -415,10 +415,10 @@ bool TorClient::readCookie() void TorClient::readRouters() { - QFile inf(QString("%1/.tor/cached-status/7EA6EAD6FD83083C538F44038BBFA077587DD755").arg(getenv("HOME"))); + TQFile inf(TQString("%1/.tor/cached-status/7EA6EAD6FD83083C538F44038BBFA077587DD755").arg(getenv("HOME"))); if ( inf.open(IO_ReadOnly) ) { - QTextStream stream( &inf ); - QString line; + TQTextStream stream( &inf ); + TQString line; while ( !stream.atEnd() ) { line = stream.readLine(); // line of text excluding '\n' parseDirStatus(line); @@ -454,23 +454,23 @@ void TorClient::bandwidth() //interface when warned - but only for that session. m_portsToReject.clear(); m_portsToReject << "23" << "109" << "110" << "143"; - sendToServer(QString("SETCONF WarnPlainTextPorts=%1") + sendToServer(TQString("SETCONF WarnPlainTextPorts=%1") .arg(m_portsToReject.join(","))); - sendToServer(QString("SETCONF RejectPlainTextPorts=%1") + sendToServer(TQString("SETCONF RejectPlainTextPorts=%1") .arg(m_portsToReject.join(","))); sendToServer("SETEVENTS EXTENDED CIRC STREAM ORCONN NOTICE " "WARN ERR ADDRMAP BW STREAM_BW NS STATUS_GENERAL " "STATUS_CLIENT STATUS_SERVER GUARD"); - sendToServer(QString("SETCONF __ReloadTorrcOnSIGHUP=0")); + sendToServer(TQString("SETCONF __ReloadTorrcOnSIGHUP=0")); } -void TorClient::handle250(const QString &lin) +void TorClient::handle250(const TQString &lin) { - QString line = lin; + TQString line = lin; if ((line.contains("250-circuit-status="))){ if (line != ".") @@ -514,11 +514,11 @@ void TorClient::handle250(const QString &lin) else if (line.contains("250 MaxAdvertisedBandwidth=")) m_CurMaxAdvertisedBandwidth = line.section("=",1,1).toInt(); else if (line.contains("250 ExcludeNodes=")) - TorkConfig::setCurrentExcludeNodes(QStringList::split(",",line.replace("250 ExcludeNodes=",""))); + TorkConfig::setCurrentExcludeNodes(TQStringList::split(",",line.replace("250 ExcludeNodes=",""))); else if (line.contains("250 EntryNodes=")) - TorkConfig::setCurrentEntryNodes(QStringList::split(",",line.replace("250 EntryNodes=",""))); + TorkConfig::setCurrentEntryNodes(TQStringList::split(",",line.replace("250 EntryNodes=",""))); else if (line.contains("250 ExitNodes=")) - TorkConfig::setCurrentExitNodes(QStringList::split(",",line.replace("250 ExitNodes=",""))); + TorkConfig::setCurrentExitNodes(TQStringList::split(",",line.replace("250 ExitNodes=",""))); else if (line.contains("250-status/circuit-established=1")) updateClientReport("CIRCUIT_ESTABLISHED"); else if (line.contains("250-status/circuit-established=0")) @@ -529,19 +529,19 @@ void TorClient::handle250(const QString &lin) }else if (line.contains("250-status/enough-dir-info=0")) updateClientReport("NOT_ENOUGH_DIR_INFO"); else if (line.contains("250-status/good-server-descriptor=1")) - updateServerReport("GOOD_SERVER_DESCRIPTOR", QString()); + updateServerReport("GOOD_SERVER_DESCRIPTOR", TQString()); else if (line.contains("250-status/good-server-descriptor=0")) - updateServerReport("BAD_SERVER_DESCRIPTOR", QString()); + updateServerReport("BAD_SERVER_DESCRIPTOR", TQString()); else if (line.contains("250-status/reachability-succeeded/or=1")) - updateServerReport("REACHABILITY_SUCCEEDED", QString()); + updateServerReport("REACHABILITY_SUCCEEDED", TQString()); else if (line.contains("250-status/reachability-succeeded/or=0")) - updateServerReport("REACHABILITY_FAILED", QString()); + updateServerReport("REACHABILITY_FAILED", TQString()); } void TorClient::socketReadyRead() { - QString line; + TQString line; // read from the server while ( socket->canReadLine() ) { @@ -607,7 +607,7 @@ void TorClient::socketReadyRead() continue; } - QString code = line.left(3); + TQString code = line.left(3); if (code == "250") handle250(line); @@ -616,20 +616,20 @@ void TorClient::socketReadyRead() m_expectingDirStatus= true; continue; } - QString eventType = line.section(" ",1,1); - QString eventInfo = line.section(" ",2); + TQString eventType = line.section(" ",1,1); + TQString eventInfo = line.section(" ",2); if (eventInfo.contains("circuit_testing_failed")) emit serverError(); parseEvent(eventType,eventInfo); }else if (code == "552"){ - QString eventInfo = line.section(" ",1); + TQString eventInfo = line.section(" ",1); emit displayError("Sorry!", eventInfo); }else if (code == "514"){ - QString eventInfo = line.section(" ",1); + TQString eventInfo = line.section(" ",1); emit processWarning("authenticationrequired", eventInfo); emit fatalError(); }else if (code == "515"){ - QString eventInfo = line.section(" ",1); + TQString eventInfo = line.section(" ",1); if (eventInfo.contains("Wrong length")) emit processQuestion("cookierequired", eventInfo); else{ @@ -646,7 +646,7 @@ void TorClient::socketReadyRead() } } -void TorClient::parseEvent(const QString &type, const QString &info) +void TorClient::parseEvent(const TQString &type, const TQString &info) { if (info.isEmpty()) @@ -680,11 +680,11 @@ void TorClient::parseEvent(const QString &type, const QString &info) parseInfo(type,info); } -void TorClient::parseStatusGeneral(const QString &info) +void TorClient::parseStatusGeneral(const TQString &info) { - QString severity = info.section(" ",0,0); - QString action = info.section(" ",1,1); - QString message = statusMessage[action]; + TQString severity = info.section(" ",0,0); + TQString action = info.section(" ",1,1); + TQString message = statusMessage[action]; if (!serverStatus[action].isEmpty()) updateServerReport(action, info); @@ -706,14 +706,14 @@ void TorClient::parseStatusGeneral(const QString &info) } -void TorClient::populateMessageFromStatusDetail(const QString &line, QString &message) +void TorClient::populateMessageFromStatusDetail(const TQString &line, TQString &message) { - QRegExp rx("[\\sA-Z0-9]+[=]([\\-\\:\\.\\(\\)a-zA-Z0-9]+|\\\"[\\-\\.\\,a-zA-Z0-9\\s]+\\\")"); + TQRegExp rx("[\\sA-Z0-9]+[=]([\\-\\:\\.\\(\\)a-zA-Z0-9]+|\\\"[\\-\\.\\,a-zA-Z0-9\\s]+\\\")"); int pos = 0; while ( (pos = rx.search(line, pos)) != -1 ) { /* kdDebug() << rx.cap(0) << endl;*/ - QString keyword = rx.cap(0).section("=",0,0).stripWhiteSpace(); - QString value = rx.cap(0).section("=",1,1).stripWhiteSpace(); + TQString keyword = rx.cap(0).section("=",0,0).stripWhiteSpace(); + TQString value = rx.cap(0).section("=",1,1).stripWhiteSpace(); message.replace(keyword,value); pos += rx.matchedLength(); if (keyword=="PORT"){ @@ -723,7 +723,7 @@ void TorClient::populateMessageFromStatusDetail(const QString &line, QString &me } } -void TorClient::updateServerReport(const QString &message, const QString &info) +void TorClient::updateServerReport(const TQString &message, const TQString &info) { // kdDebug() << serverStatusIcon[message] << endl; // kdDebug() << message << endl; @@ -737,10 +737,10 @@ void TorClient::updateServerReport(const QString &message, const QString &info) emit updateTrayIcon(serverStatusIcon[message]); serverReport.remove("<font color='#990000'>Status Not Known</font>"); - QString msg = serverStatus[message]; + TQString msg = serverStatus[message]; if (message.contains("EXTERNAL_ADDRESS")){ - for ( QStringList::Iterator it = serverReport.begin(); it != serverReport.end(); ++it ) + for ( TQStringList::Iterator it = serverReport.begin(); it != serverReport.end(); ++it ) { // XXX Fixme if ((*it).contains("Using Address")){ @@ -762,7 +762,7 @@ void TorClient::updateServerReport(const QString &message, const QString &info) serverReport.append(msg); } -void TorClient::updateClientReport(const QString &message) +void TorClient::updateClientReport(const TQString &message) { if (!clientStatusIcon[message].isEmpty() && (TorkConfig::clientOnly())) emit updateTrayIcon(clientStatusIcon[clientStatus[message]]); @@ -775,38 +775,38 @@ void TorClient::resetClientReport() emit updateTrayIcon(clientStatusIcon[clientReport.first()]); } -void TorClient::parseBW(const QString &info) +void TorClient::parseBW(const TQString &info) { - QString in = info.section(" ",0,0); - QString out = info.section(" ",1,1); + TQString in = info.section(" ",0,0); + TQString out = info.section(" ",1,1); emit bwUpdate(in, out); } -void TorClient::parseStreamBW(const QString &info) +void TorClient::parseStreamBW(const TQString &info) { - QString stream = info.section(" ",0,0); + TQString stream = info.section(" ",0,0); /* Tor spec had it wrong way round! */ - QString out = info.section(" ",1,1); - QString in = info.section(" ",2,2); + TQString out = info.section(" ",1,1); + TQString in = info.section(" ",2,2); emit streamBwUpdate(stream, in, out); } -void TorClient::parseStream(const QString &info) +void TorClient::parseStream(const TQString &info) { - QString streamID = info.section(" ",0,0); - QString status = info.section(" ",1,1); - QString circID = info.section(" ",2,2); - QString Target = info.section(" ",3,3); + TQString streamID = info.section(" ",0,0); + TQString status = info.section(" ",1,1); + TQString circID = info.section(" ",2,2); + TQString Target = info.section(" ",3,3); //We ignore REMAPs because we don't do anything with them if (status == "REMAP") @@ -816,13 +816,13 @@ void TorClient::parseStream(const QString &info) } -void TorClient::parseServer(const QString &info) +void TorClient::parseServer(const TQString &info) { kdDebug() << "server info " << info << endl; if (info.left(7) == "router "){ - QString ip = info.section(" ",2,2); - QString cc; + TQString ip = info.section(" ",2,2); + TQString cc; GeoIP * gi = 0; @@ -859,11 +859,11 @@ void TorClient::parseServer(const QString &info) }else if (info.left(6) == "uptime"){ //from the clever ktorrent KLocale* loc = KGlobal::locale(); - QTime t; + TQTime t; int nsecs = info.section(" ",1).toInt(); int ndays = (nsecs) / 86400; t = t.addSecs(nsecs % 86400); - QString s = loc->formatTime(t,true,true); + TQString s = loc->formatTime(t,true,true); if (ndays > 0) s = i18n("1 day ","%n days ",ndays) + s; @@ -871,14 +871,14 @@ void TorClient::parseServer(const QString &info) }else if (info.left(20).contains("write-history")){ - QStringList bwlist = QStringList::split(",",info.section(" ",-1)); + TQStringList bwlist = TQStringList::split(",",info.section(" ",-1)); - QValueList<int> bws; + TQValueList<int> bws; bws << 4 << 24 << 48 << bwlist.count(); - QString bwup; - QString avgbw; - for ( QValueList<int>::Iterator it = bws.begin(); it != bws.end(); ++it ){ + TQString bwup; + TQString avgbw; + for ( TQValueList<int>::Iterator it = bws.begin(); it != bws.end(); ++it ){ avgbw = calcBW(bwlist, (*it)); for (int i = avgbw.length(); i < 14; i++) avgbw.append(" "); @@ -890,13 +890,13 @@ void TorClient::parseServer(const QString &info) m_statustiptmp.replace("$INTERVALTIME", info.section(" ",2,3)); }else if (info.left(20).contains("read-history")){ - QStringList bwlist = QStringList::split(",",info.section(" ",-1)); - QValueList<int> bws; + TQStringList bwlist = TQStringList::split(",",info.section(" ",-1)); + TQValueList<int> bws; bws << 4 << 24 << 48 << bwlist.count(); - QString bwup; - QString avgbw; - for ( QValueList<int>::Iterator it = bws.begin(); it != bws.end(); ++it ){ + TQString bwup; + TQString avgbw; + for ( TQValueList<int>::Iterator it = bws.begin(); it != bws.end(); ++it ){ avgbw = calcBW(bwlist, (*it)); for (int i = avgbw.length(); i < 14; i++) avgbw.append(" "); @@ -926,12 +926,12 @@ void TorClient::parseServer(const QString &info) } } -void TorClient::parseAddrmap(const QString &info) +void TorClient::parseAddrmap(const TQString &info) { - QString type = info.section(" ",0,0); - QString address = info.section(" ",1,1); + TQString type = info.section(" ",0,0); + TQString address = info.section(" ",1,1); // If this is a request to resolve a hostname/address from the traffic // logs @@ -955,33 +955,33 @@ void TorClient::parseAddrmap(const QString &info) } -void TorClient::parseGuards(const QString &info) +void TorClient::parseGuards(const TQString &info) { - QString fp_identity = info.section(" ",0,0); - QString status = info.section(" ",1,1); - QRegExp rx("(\\$[A-Z0-9]{40})"); + TQString fp_identity = info.section(" ",0,0); + TQString status = info.section(" ",1,1); + TQRegExp rx("(\\$[A-Z0-9]{40})"); rx.search(fp_identity); - QString server = getNickNameFromFP(rx.cap(0)); + TQString server = getNickNameFromFP(rx.cap(0)); if (!server.isEmpty()){ emit guardStatusUpdate(server, status); } } -void TorClient::parseCircuit(const QString &info) +void TorClient::parseCircuit(const TQString &info) { if (info.contains("FAILED")) emit displayError("Circuit Failed - "+info.section(" ",3,3).replace("REASON=",""), "Circuit: " + info.section(" ",2,2)); - QString circuitID = info.section(" ",0,0).stripWhiteSpace(); - QString status = info.section(" ",1,1).stripWhiteSpace(); - QString path = info.section(" ",2,2).stripWhiteSpace(); + TQString circuitID = info.section(" ",0,0).stripWhiteSpace(); + TQString status = info.section(" ",1,1).stripWhiteSpace(); + TQString path = info.section(" ",2,2).stripWhiteSpace(); //Get the FP Digest (if any) of the last server in the circuit - QString exit; - QRegExp rx("(\\$[A-Z0-9]{40})"); + TQString exit; + TQRegExp rx("(\\$[A-Z0-9]{40})"); int count = 0; int pos = 0; while ( (pos = rx.search(path, pos)) != -1 ) { @@ -992,49 +992,49 @@ void TorClient::parseCircuit(const QString &info) if (!exit.isEmpty()) exit = getFPDigestFromFP(exit); //Strip out the FPs from the circuit, if any - path.replace(QRegExp("(\\$[A-Z0-9]{40})(~|=)"),""); + path.replace(TQRegExp("(\\$[A-Z0-9]{40})(~|=)"),""); emit circuitStatusUpdate(circuitID, status, path, exit); } -void TorClient::parseORConn(const QString &info) +void TorClient::parseORConn(const TQString &info) { - QString serverID = info.section(" ",0,0); - QString status = info.section(" ",1,1); + TQString serverID = info.section(" ",0,0); + TQString status = info.section(" ",1,1); if (serverID.startsWith("$")){ - QString server = getNickNameFromFP(serverID); + TQString server = getNickNameFromFP(serverID); if (!server.isEmpty()) serverID = server; } if (!status.contains("NEW")){ - serverID.replace(QRegExp("^[A-Z0-9$=~]{42}"),""); + serverID.replace(TQRegExp("^[A-Z0-9$=~]{42}"),""); emit ORStatusUpdate(serverID, status); } } -void TorClient::parseInfo(const QString &type,const QString &info) +void TorClient::parseInfo(const TQString &type,const TQString &info) { - QString message = info; - message.replace(QRegExp("^[a-zA-Z0-9_]+\\(\\):"),""); -// QString summary = info.section(":",0,0); -// QString data = info.section(":",1); + TQString message = info; + message.replace(TQRegExp("^[a-zA-Z0-9_]+\\(\\):"),""); +// TQString summary = info.section(":",0,0); +// TQString data = info.section(":",1); if (info.contains("Servers unavailable")) emit displayServer("Server Info", "<b>Server appears to be down!</b>"); - emit infoUpdate(type, message, QString()); + emit infoUpdate(type, message, TQString()); } -void TorClient::updateCandidateServers(const QString &path) +void TorClient::updateCandidateServers(const TQString &path) { - QStringList servers = QStringList::split(",", path); - QStringList existingServers = TorkConfig::serversHistory(); - for ( QStringList::Iterator it = servers.begin(); it != servers.end(); ++it ) + TQStringList servers = TQStringList::split(",", path); + TQStringList existingServers = TorkConfig::serversHistory(); + for ( TQStringList::Iterator it = servers.begin(); it != servers.end(); ++it ) { if ((*it).isEmpty()) continue; @@ -1046,26 +1046,26 @@ void TorClient::updateCandidateServers(const QString &path) TorkConfig::writeConfig(); } -void TorClient::attemptAttach(const QString &circid, const QString &streamid) +void TorClient::attemptAttach(const TQString &circid, const TQString &streamid) { - QStringList streams = QStringList::split( " ", streamid); - for ( QStringList::Iterator it = streams.begin(); it != streams.end(); ++it ) + TQStringList streams = TQStringList::split( " ", streamid); + for ( TQStringList::Iterator it = streams.begin(); it != streams.end(); ++it ) { if ((*it).isEmpty()) continue; - sendToServer(QString("ATTACHSTREAM %1 %2").arg(*it).arg(circid)); + sendToServer(TQString("ATTACHSTREAM %1 %2").arg(*it).arg(circid)); } } -void TorClient::attemptExtendCircuit(const QString &circid, const QString &serverlist, bool usefp) +void TorClient::attemptExtendCircuit(const TQString &circid, const TQString &serverlist, bool usefp) { - QStringList servers = QStringList::split( " ", serverlist); - QStringList circuitlist; - for ( QStringList::Iterator it = servers.begin(); it != servers.end(); ++it ) + TQStringList servers = TQStringList::split( " ", serverlist); + TQStringList circuitlist; + for ( TQStringList::Iterator it = servers.begin(); it != servers.end(); ++it ) { if ((*it).isEmpty()) continue; @@ -1075,16 +1075,16 @@ void TorClient::attemptExtendCircuit(const QString &circid, const QString &serve circuitlist.append((*it)); } - QString circuit = circuitlist.join(","); - sendToServer(QString("EXTENDCIRCUIT %1 %2").arg(circid).arg(circuit)); + TQString circuit = circuitlist.join(","); + sendToServer(TQString("EXTENDCIRCUIT %1 %2").arg(circid).arg(circuit)); } -void TorClient::attemptCreateCircuit(const QString &serverlist, bool usefp) +void TorClient::attemptCreateCircuit(const TQString &serverlist, bool usefp) { - QStringList servers = QStringList::split( " ", serverlist); - QStringList circuitlist; - for ( QStringList::Iterator it = servers.begin(); it != servers.end(); ++it ) + TQStringList servers = TQStringList::split( " ", serverlist); + TQStringList circuitlist; + for ( TQStringList::Iterator it = servers.begin(); it != servers.end(); ++it ) { if ((*it).isEmpty()) continue; @@ -1094,23 +1094,23 @@ void TorClient::attemptCreateCircuit(const QString &serverlist, bool usefp) circuitlist.append((*it)); } - QString circuit = circuitlist.join(","); - sendToServer(QString("EXTENDCIRCUIT 0 %1").arg(circuit)); + TQString circuit = circuitlist.join(","); + sendToServer(TQString("EXTENDCIRCUIT 0 %1").arg(circuit)); } -void TorClient::attemptCloseStream(const QString &streamid) +void TorClient::attemptCloseStream(const TQString &streamid) { - sendToServer(QString("CLOSESTREAM %1 1").arg(streamid)); + sendToServer(TQString("CLOSESTREAM %1 1").arg(streamid)); } void TorClient::attemptAttachStreams( bool attachStreams) { - sendToServer(QString("SETCONF __LeaveStreamsUnattached=%1").arg(attachStreams)); + sendToServer(TQString("SETCONF __LeaveStreamsUnattached=%1").arg(attachStreams)); } -void TorClient::attemptCloseCircuit(const QString &circuitid) +void TorClient::attemptCloseCircuit(const TQString &circuitid) { - sendToServer(QString("CLOSECIRCUIT %1").arg(circuitid)); + sendToServer(TQString("CLOSECIRCUIT %1").arg(circuitid)); } @@ -1150,7 +1150,7 @@ void TorClient::applySettingsToRunningTor() if (elementShouldBeUsed((*it))){ if (noSpecialProcessing((*it))){ PrevConfig::PrevConfigList::iterator mit; - QVariant oldvalue; + TQVariant oldvalue; for( mit = m_previtems.begin(); mit != m_previtems.end(); ++mit ) { if ((*mit).name() == (*it)->name()){ oldvalue = (*mit).property(); @@ -1159,21 +1159,21 @@ void TorClient::applySettingsToRunningTor() } - if ( (*it)->property().type() == QVariant::String ) { + if ( (*it)->property().type() == TQVariant::String ) { if ((oldvalue !=(*it)->property())){ - ( sendToServer(QString("SETCONF %1=%2").arg((*it)->name()).arg((*it)->property().toString()))); + ( sendToServer(TQString("SETCONF %1=%2").arg((*it)->name()).arg((*it)->property().toString()))); } - }else if ( (*it)->property().type() == QVariant::StringList ) { + }else if ( (*it)->property().type() == TQVariant::StringList ) { if ((oldvalue !=(*it)->property())){ - ( sendToServer(QString("SETCONF %1=\"%2\"").arg((*it)->name()).arg( (*it)->property().toStringList().join(",")))); + ( sendToServer(TQString("SETCONF %1=\"%2\"").arg((*it)->name()).arg( (*it)->property().toStringList().join(",")))); } - }else if ( (*it)->property().type() == QVariant::Int ) { + }else if ( (*it)->property().type() == TQVariant::Int ) { if ((oldvalue !=(*it)->property())){ - ( sendToServer(QString("SETCONF %1=%2").arg((*it)->name()).arg( (*it)->property().toString()))); + ( sendToServer(TQString("SETCONF %1=%2").arg((*it)->name()).arg( (*it)->property().toString()))); } - }else if ( (*it)->property().type() == QVariant::Bool ) { + }else if ( (*it)->property().type() == TQVariant::Bool ) { if ((oldvalue !=(*it)->property())){ - ( sendToServer(QString("SETCONF %1=%2").arg((*it)->name()).arg( (*it)->property().toInt()))); + ( sendToServer(TQString("SETCONF %1=%2").arg((*it)->name()).arg( (*it)->property().toInt()))); } } @@ -1183,33 +1183,33 @@ void TorClient::applySettingsToRunningTor() if (TorkConfig::useProxy()){ if ((TorkConfig::httpProxyPort() > 0) && (!TorkConfig::httpProxyHost().isEmpty())) - ( sendToServer(QString("SETCONF HttpProxy=%1:%2").arg(TorkConfig::httpProxyHost()).arg(TorkConfig::httpProxyPort()))) ; + ( sendToServer(TQString("SETCONF HttpProxy=%1:%2").arg(TorkConfig::httpProxyHost()).arg(TorkConfig::httpProxyPort()))) ; if ((TorkConfig::httpsProxyPort() > 0) && (!TorkConfig::httpsProxyHost().isEmpty())) - ( sendToServer(QString("SETCONF HttpsProxy=%1:%2").arg(TorkConfig::httpsProxyHost()).arg(TorkConfig::httpsProxyPort()))) ; + ( sendToServer(TQString("SETCONF HttpsProxy=%1:%2").arg(TorkConfig::httpsProxyHost()).arg(TorkConfig::httpsProxyPort()))) ; if ((!TorkConfig::httpProxyAuthenticatorUserName().isEmpty()) && (!TorkConfig::httpProxyAuthenticatorPassword().isEmpty())) - ( sendToServer(QString("SETCONF HttpProxyAuthenticator=%1:%2").arg(TorkConfig::httpProxyAuthenticatorUserName()).arg(TorkConfig::httpProxyAuthenticatorPassword()))); + ( sendToServer(TQString("SETCONF HttpProxyAuthenticator=%1:%2").arg(TorkConfig::httpProxyAuthenticatorUserName()).arg(TorkConfig::httpProxyAuthenticatorPassword()))); if ((!TorkConfig::httpsProxyAuthenticatorUserName().isEmpty()) && (!TorkConfig::httpsProxyAuthenticatorPassword().isEmpty())) - ( sendToServer(QString("SETCONF HttpsProxyAuthenticator=%1:%2").arg(TorkConfig::httpsProxyAuthenticatorUserName() ).arg(TorkConfig::httpsProxyAuthenticatorPassword()))); + ( sendToServer(TQString("SETCONF HttpsProxyAuthenticator=%1:%2").arg(TorkConfig::httpsProxyAuthenticatorUserName() ).arg(TorkConfig::httpsProxyAuthenticatorPassword()))); }else{ - ( sendToServer(QString("SETCONF HttpProxy="))); - ( sendToServer(QString("SETCONF HttpsProxy="))); - ( sendToServer(QString("SETCONF HttpProxyAuthenticator="))); - ( sendToServer(QString("SETCONF HttpsProxyAuthenticator="))); + ( sendToServer(TQString("SETCONF HttpProxy="))); + ( sendToServer(TQString("SETCONF HttpsProxy="))); + ( sendToServer(TQString("SETCONF HttpProxyAuthenticator="))); + ( sendToServer(TQString("SETCONF HttpsProxyAuthenticator="))); } if ((!TorkConfig::sOCKSBindAddressHost().isEmpty()) && (TorkConfig::sOCKSBindAddressPort() > -1)) - ( sendToServer(QString("SETCONF SOCKSListenAddress=%1:%2").arg(TorkConfig::sOCKSBindAddressHost()).arg( TorkConfig::sOCKSBindAddressPort()))) ; + ( sendToServer(TQString("SETCONF SOCKSListenAddress=%1:%2").arg(TorkConfig::sOCKSBindAddressHost()).arg( TorkConfig::sOCKSBindAddressPort()))) ; if ((TorkConfig::sOCKSBindAddressHost().isEmpty()) && (TorkConfig::sOCKSBindAddressPort() > -1)) - ( sendToServer(QString("SETCONF SOCKSPort=%2").arg(TorkConfig::sOCKSBindAddressPort()))) ; + ( sendToServer(TQString("SETCONF SOCKSPort=%2").arg(TorkConfig::sOCKSBindAddressPort()))) ; emit copyOldConfig(); emit makeTorkStoppable(); - sendToServer(QString("GETCONF ExcludeNodes")) ; - sendToServer(QString("GETCONF ExitNodes")) ; - sendToServer(QString("GETCONF EntryNodes")) ; + sendToServer(TQString("GETCONF ExcludeNodes")) ; + sendToServer(TQString("GETCONF ExitNodes")) ; + sendToServer(TQString("GETCONF EntryNodes")) ; } @@ -1243,7 +1243,7 @@ bool TorClient::noSpecialProcessing(const KConfigSkeletonItem* it) { if (((*it).name() == "PublishServerDescriptor") && (TorkConfig::bridgeRelay())){ - sendToServer(QString("setconf PublishServerDescriptor=bridge")); + sendToServer(TQString("setconf PublishServerDescriptor=bridge")); return false; } @@ -1252,7 +1252,7 @@ bool TorClient::noSpecialProcessing(const KConfigSkeletonItem* it) (!TorkConfig::cookieAuthentication()) && TorkConfig::generateRandomPassword()){ crypto_seed_rng(); - sendToServer(QString("setconf %1=16:%2") + sendToServer(TQString("setconf %1=16:%2") .arg((*it).name()) .arg(hashPassword(crypto_rand_string(16)))); return false; @@ -1262,50 +1262,50 @@ bool TorClient::noSpecialProcessing(const KConfigSkeletonItem* it) if ((*it).group() == "DefaultServerAddress"){ if ((*it).name() == "ORPort") - ( sendToServer(QString("SETCONF %1=%2").arg((*it).name()) + ( sendToServer(TQString("SETCONF %1=%2").arg((*it).name()) .arg( (*it).property().toString()))); return false; } if (((*it).name() == "BandwidthBurst") || ((*it).name() == "BandwidthRate")){ - ( sendToServer(QString("SETCONF BandwidthBurst=%1KB BandwidthRate=%2KB") + ( sendToServer(TQString("SETCONF BandwidthBurst=%1KB BandwidthRate=%2KB") .arg(TorkConfig::bandwidthBurst()).arg(TorkConfig::bandwidthRate()))); getBandwidth(); return false; } if ((*it).name() == "MaxAdvertisedBandwidth"){ - ( sendToServer(QString("SETCONF %1=%2KB").arg((*it).name()).arg( (*it).property().toString()))); + ( sendToServer(TQString("SETCONF %1=%2KB").arg((*it).name()).arg( (*it).property().toString()))); getBandwidth(); return false; } if ((*it).name() == "AccountingMax"){ - ( sendToServer(QString("SETCONF %1=\"%2 bytes\"").arg((*it).name()).arg( ((*it).property().toInt() * 1024 * 1024)))); + ( sendToServer(TQString("SETCONF %1=\"%2 bytes\"").arg((*it).name()).arg( ((*it).property().toInt() * 1024 * 1024)))); return false; } if ((*it).name() == "AccountingStart"){ if ((*it).property().toString() == "day") - ( sendToServer(QString("SETCONF %1=\"%2 00:00\"").arg((*it).name()).arg( (*it).property().toString()))); + ( sendToServer(TQString("SETCONF %1=\"%2 00:00\"").arg((*it).name()).arg( (*it).property().toString()))); else - ( sendToServer(QString("SETCONF %1=\"%2 1 00:00\"").arg((*it).name()).arg( (*it).property().toString()))); + ( sendToServer(TQString("SETCONF %1=\"%2 1 00:00\"").arg((*it).name()).arg( (*it).property().toString()))); return false; } if ((*it).name() == "KeepalivePeriod"){ if (!TorkConfig::reachableAddresses().isEmpty()){ - ( sendToServer(QString("SETCONF %1=%2").arg((*it).name()).arg( ((*it).property().toInt() * 60)))) ; + ( sendToServer(TQString("SETCONF %1=%2").arg((*it).name()).arg( ((*it).property().toInt() * 60)))) ; } return false; } if ((*it).name() == "TrackHostExits"){ if (!TorkConfig::trackHostExits().isEmpty()){ - ( sendToServer(QString("SETCONF %1=%2").arg((*it).name()).arg( ((*it).property().toStringList().join(","))))) ; + ( sendToServer(TQString("SETCONF %1=%2").arg((*it).name()).arg( ((*it).property().toStringList().join(","))))) ; if (TorkConfig::trackHostExitsExpire() > 0) - ( sendToServer(QString("SETCONF TrackHostExitsExpire=%2").arg((TorkConfig::trackHostExitsExpire() * 60)))) ; + ( sendToServer(TQString("SETCONF TrackHostExitsExpire=%2").arg((TorkConfig::trackHostExitsExpire() * 60)))) ; } return false; } @@ -1314,12 +1314,12 @@ bool TorClient::noSpecialProcessing(const KConfigSkeletonItem* it) if ((*it).name() == "SOCKSBindAddressMany"){ if (!TorkConfig::sOCKSBindAddressMany().isEmpty()){ - QStringList socksbind = TorkConfig::sOCKSBindAddressMany(); - for ( QStringList::Iterator it = (socksbind).begin(); it != (socksbind).end(); it++ ) + TQStringList socksbind = TorkConfig::sOCKSBindAddressMany(); + for ( TQStringList::Iterator it = (socksbind).begin(); it != (socksbind).end(); it++ ) { if ((*it).isEmpty()) continue; - ( sendToServer(QString("SETCONF SOCKSListenAddress=%2").arg((*it)))) ; + ( sendToServer(TQString("SETCONF SOCKSListenAddress=%2").arg((*it)))) ; } } return false; @@ -1327,83 +1327,83 @@ bool TorClient::noSpecialProcessing(const KConfigSkeletonItem* it) if ((*it).name() == "ExitPolicy"){ if (TorkConfig::middleMan()) - ( sendToServer(QString("SETCONF ExitPolicy=%1").arg(("\"reject *:*\"")))) ; + ( sendToServer(TQString("SETCONF ExitPolicy=%1").arg(("\"reject *:*\"")))) ; else - ( sendToServer(QString("SETCONF %1=\"%2\"").arg((*it).name()).arg( (*it).property().toStringList().join(",")))); + ( sendToServer(TQString("SETCONF %1=\"%2\"").arg((*it).name()).arg( (*it).property().toStringList().join(",")))); return false; } if ((*it).name() == "HiddenServices"){ - QStringList hiddenServices = TorkConfig::hiddenServices(); - QString allservices; - for ( QStringList::Iterator it = (hiddenServices).begin(); it != (hiddenServices).end(); it++ ) + TQStringList hiddenServices = TorkConfig::hiddenServices(); + TQString allservices; + for ( TQStringList::Iterator it = (hiddenServices).begin(); it != (hiddenServices).end(); it++ ) { if ((*it).isEmpty()) continue; - allservices += (QString("HiddenServiceDir=\"%1\" HiddenServicePort=\"%2 %3\" ").arg((*it).section("\n",-1)).arg((*it).section("\n",-4,-4)).arg((*it).section("\n",-3,-3))) ; + allservices += (TQString("HiddenServiceDir=\"%1\" HiddenServicePort=\"%2 %3\" ").arg((*it).section("\n",-1)).arg((*it).section("\n",-4,-4)).arg((*it).section("\n",-3,-3))) ; } if (!allservices.isEmpty()) - ( sendToServer(QString("SETCONF %1").arg(allservices))) ; + ( sendToServer(TQString("SETCONF %1").arg(allservices))) ; else - ( sendToServer(QString("SETCONF HiddenServiceDir= HiddenServicePort="))) ; + ( sendToServer(TQString("SETCONF HiddenServiceDir= HiddenServicePort="))) ; return false; } if ((TorkConfig::useBridges()) && ((*it).name() == "Bridge")){ - QStringList bridges = TorkConfig::bridge(); - QString allbridges; - for ( QStringList::Iterator it = (bridges).begin(); it != (bridges).end(); it++ ) + TQStringList bridges = TorkConfig::bridge(); + TQString allbridges; + for ( TQStringList::Iterator it = (bridges).begin(); it != (bridges).end(); it++ ) { if ((*it).isEmpty()) continue; - allbridges += (QString("Bridge=\"%1\" ") + allbridges += (TQString("Bridge=\"%1\" ") .arg((*it))) ; } if (!allbridges.isEmpty()) - ( sendToServer(QString("SETCONF %1").arg(allbridges))) ; + ( sendToServer(TQString("SETCONF %1").arg(allbridges))) ; else - ( sendToServer(QString("SETCONF Bridge="))) ; + ( sendToServer(TQString("SETCONF Bridge="))) ; return false; } if ((*it).name() == "MyFamily"){ - QStringList family = TorkConfig::myFamily(); - QStringList allfamily; - for ( QStringList::Iterator it = (family).begin(); it != (family).end(); it++ ) + TQStringList family = TorkConfig::myFamily(); + TQStringList allfamily; + for ( TQStringList::Iterator it = (family).begin(); it != (family).end(); it++ ) { if ((*it).isEmpty()) continue; - QString node = "$"+getFPFromFPDigest((*it).section("-",1,1)); + TQString node = "$"+getFPFromFPDigest((*it).section("-",1,1)); allfamily.append(node) ; } if (!allfamily.isEmpty()) - ( sendToServer(QString("SETCONF MyFamily=%1").arg(allfamily.join(",")))) ; + ( sendToServer(TQString("SETCONF MyFamily=%1").arg(allfamily.join(",")))) ; else - ( sendToServer(QString("SETCONF MyFamily="))) ; + ( sendToServer(TQString("SETCONF MyFamily="))) ; return false; } if ((*it).name() == "MapAddress"){ - QStringList maps = TorkConfig::mapAddress(); - for ( QStringList::Iterator it = (maps).begin(); + TQStringList maps = TorkConfig::mapAddress(); + for ( TQStringList::Iterator it = (maps).begin(); it != (maps).end(); it++ ) { if ((*it).isEmpty()) continue; - ( sendToServer(QString("SETCONF MapAddress=%2").arg((*it)))) ; + ( sendToServer(TQString("SETCONF MapAddress=%2").arg((*it)))) ; } return false; } if ((!TorkConfig::fascistFirewall()) && ((*it).name() == "ReachableAddresses")){ - ( sendToServer(QString("SETCONF ReachableAddresses="))) ; + ( sendToServer(TQString("SETCONF ReachableAddresses="))) ; return false; } return true; @@ -1416,7 +1416,7 @@ void TorClient::cleanUp() if (TorkConfig::hashedControlPassword().isEmpty() && (!TorkConfig::cookieAuthentication()) && TorkConfig::generateRandomPassword()){ - sendToServer(QString("setconf HashedControlPassword=")); + sendToServer(TQString("setconf HashedControlPassword=")); socket->flush(); } } @@ -1426,7 +1426,7 @@ TorClient::~TorClient() } -void TorClient::parseDirStatus(const QString &info) +void TorClient::parseDirStatus(const TQString &info) { @@ -1440,7 +1440,7 @@ void TorClient::parseDirStatus(const QString &info) if (info.left(2) == "s "){ - if (QDate::currentDate().daysTo(QDate(ds_date.left(4).toInt(), + if (TQDate::currentDate().daysTo(TQDate(ds_date.left(4).toInt(), ds_date.mid(5,2).toInt(),ds_date.right(2).toInt())) > -30) { if (server(ds_identity).isEmpty()) storeServer(ds_server,ds_identity); @@ -1458,23 +1458,23 @@ bool TorClient::isControllerWorking() } -void TorClient::setBandwidth(const QString &rate, const QString &burst, const QString &max) +void TorClient::setBandwidth(const TQString &rate, const TQString &burst, const TQString &max) { - ( sendToServer(QString("SETCONF BandwidthRate=%2KB BandwidthBurst=%2KB") + ( sendToServer(TQString("SETCONF BandwidthRate=%2KB BandwidthBurst=%2KB") .arg(rate).arg(burst))); if (!max.isEmpty()) - ( sendToServer(QString("SETCONF MaxAdvertisedBandwidth=%2KB").arg(max))); + ( sendToServer(TQString("SETCONF MaxAdvertisedBandwidth=%2KB").arg(max))); getBandwidth(); } void TorClient::getBandwidth() { - ( sendToServer(QString("GETCONF BandwidthRate"))); - ( sendToServer(QString("GETCONF BandwidthBurst"))); - ( sendToServer(QString("GETCONF MaxAdvertisedBandwidth"))); + ( sendToServer(TQString("GETCONF BandwidthRate"))); + ( sendToServer(TQString("GETCONF BandwidthBurst"))); + ( sendToServer(TQString("GETCONF MaxAdvertisedBandwidth"))); } -void TorClient::handleTorVersion( const QString &caption) +void TorClient::handleTorVersion( const TQString &caption) { m_currentTorVersion = caption; if (m_currentTorVersion.left(3) == "0.2") @@ -1482,9 +1482,9 @@ void TorClient::handleTorVersion( const QString &caption) emit setTorCaption(caption); } -void TorClient::closeAllCircuits( QListView* &circuitList) +void TorClient::closeAllCircuits( TQListView* &circuitList) { - QListViewItemIterator cit(circuitList); + TQListViewItemIterator cit(circuitList); while ( cit.current() ) { attemptCloseCircuit(cit.current()->text(0)); ++cit; @@ -1511,23 +1511,23 @@ void TorClient::allowPlainTextPorts() kdDebug() << "m_portsToReject " << m_portsToReject << endl; m_portsToReject.remove(m_portsToReject.find(m_portToRemove)); - sendToServer(QString("SETCONF WarnPlainTextPorts=%1") + sendToServer(TQString("SETCONF WarnPlainTextPorts=%1") .arg(m_portsToReject.join(","))); - sendToServer(QString("SETCONF RejectPlainTextPorts=%1") + sendToServer(TQString("SETCONF RejectPlainTextPorts=%1") .arg(m_portsToReject.join(","))); } -void TorClient::resolveAddress(const QString &address) +void TorClient::resolveAddress(const TQString &address) { - QRegExp rx("[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}"); + TQRegExp rx("[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}"); rx.search(address); - QString tmp = rx.cap(0); + TQString tmp = rx.cap(0); if (tmp.isEmpty()) { sendToServer("RESOLVE " + address); logResolveList << address; }else{ sendToServer("RESOLVE mode=reverse " + tmp); - logResolveList << QString("REVERSE[%1]").arg(tmp); + logResolveList << TQString("REVERSE[%1]").arg(tmp); } } |