From 56160bf4dfe503631ef6373367b281f081bab2b4 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 16 Dec 2011 09:59:13 -0600 Subject: Revert "Rename a number of old tq methods that are no longer tq specific" This reverts commit 13281e2856a2ef43bbab78c5528470309c23aa77. --- tdecore/network/kclientsocketbase.cpp | 2 +- tdecore/network/khttpproxysocketdevice.cpp | 2 +- tdecore/network/kresolver.cpp | 30 ++++++++++++++-------------- tdecore/network/kresolver.h | 4 ++-- tdecore/network/kresolverstandardworkers.cpp | 16 +++++++-------- tdecore/network/kreverseresolver.cpp | 4 ++-- tdecore/network/kserversocket.cpp | 2 +- tdecore/network/ksocketaddress.cpp | 28 +++++++++++++------------- tdecore/network/ksocketaddress.h | 4 ++-- tdecore/network/ksocketbase.cpp | 2 +- tdecore/network/ksrvresolverworker.cpp | 8 ++++---- 11 files changed, 51 insertions(+), 51 deletions(-) (limited to 'tdecore/network') diff --git a/tdecore/network/kclientsocketbase.cpp b/tdecore/network/kclientsocketbase.cpp index f8f993a08..9785ce36c 100644 --- a/tdecore/network/kclientsocketbase.cpp +++ b/tdecore/network/kclientsocketbase.cpp @@ -148,7 +148,7 @@ bool KClientSocketBase::lookup() { if (d->localResolver.serviceName().isNull() && !d->localResolver.nodeName().isNull()) - d->localResolver.setServiceName(TQString::fromLatin1("")); + d->localResolver.setServiceName(TQString::tqfromLatin1("")); // don't restart the lookups if they had succeeded and // the input values weren't changed diff --git a/tdecore/network/khttpproxysocketdevice.cpp b/tdecore/network/khttpproxysocketdevice.cpp index f61559bfb..648f4e571 100644 --- a/tdecore/network/khttpproxysocketdevice.cpp +++ b/tdecore/network/khttpproxysocketdevice.cpp @@ -153,7 +153,7 @@ bool KHttpProxySocketDevice::connect(const TQString& node, const TQString& servi setState(0); // unset open flag // prepare the request - TQString request = TQString::fromLatin1("CONNECT %1:%2 HTTP/1.1\r\n" + TQString request = TQString::tqfromLatin1("CONNECT %1:%2 HTTP/1.1\r\n" "Cache-Control: no-cache\r\n" "Host: \r\n" "\r\n"); diff --git a/tdecore/network/kresolver.cpp b/tdecore/network/kresolver.cpp index 672edb5af..93c029b8e 100644 --- a/tdecore/network/kresolver.cpp +++ b/tdecore/network/kresolver.cpp @@ -915,7 +915,7 @@ TQString KResolver::localHostName() } if (name.isEmpty()) - return TQString::fromLatin1("localhost"); + return TQString::tqfromLatin1("localhost"); if (name.find('.') == -1) { @@ -924,7 +924,7 @@ TQString KResolver::localHostName() KResolverResults results = resolve(name, "0", CanonName); if (results.isEmpty()) // cannot find a valid hostname! - return TQString::fromLatin1("localhost"); + return TQString::tqfromLatin1("localhost"); else return results.first().canonicalName(); } @@ -934,7 +934,7 @@ TQString KResolver::localHostName() // forward declaration -static TQStringList splitLabels(const TQString& unicodeDomain); +static TQStringList splitLabels(const TQString& tqunicodeDomain); static TQCString ToASCII(const TQString& label); static TQString ToUnicode(const TQString& label); @@ -943,11 +943,11 @@ static TQStringList *KResolver_initIdnDomains() const char *kde_use_idn = getenv("KDE_USE_IDN"); if (!kde_use_idn) kde_use_idn = "ac:at:br:cat:ch:cl:cn:de:dk:fi:gr:hu:info:io:is:jp:kr:li:lt:museum:org:no:se:sh:th:tm:tw:vn"; - return new TQStringList(TQStringList::split(':', TQString::fromLatin1(kde_use_idn).lower())); + return new TQStringList(TQStringList::split(':', TQString::tqfromLatin1(kde_use_idn).lower())); } // implement the ToAscii function, as described by IDN documents -TQCString KResolver::domainToAscii(const TQString& unicodeDomain) +TQCString KResolver::domainToAscii(const TQString& tqunicodeDomain) { if (!idnDomains) idnDomains = KResolver_initIdnDomains(); @@ -958,7 +958,7 @@ TQCString KResolver::domainToAscii(const TQString& unicodeDomain) // 2) split the domain into individual labels, without // separators. - TQStringList input = splitLabels(unicodeDomain); + TQStringList input = splitLabels(tqunicodeDomain); // Do we allow IDN names for this TLD? if (input.count() && !idnDomains->contains(input[input.count()-1].lower())) @@ -987,7 +987,7 @@ TQCString KResolver::domainToAscii(const TQString& unicodeDomain) TQString KResolver::domainToUnicode(const TQCString& asciiDomain) { - return domainToUnicode(TQString::fromLatin1(asciiDomain)); + return domainToUnicode(TQString::tqfromLatin1(asciiDomain)); } // implement the ToUnicode function, as described by IDN documents @@ -1048,7 +1048,7 @@ void KResolver::virtual_hook( int, void* ) // RFC 3492 - Punycode: A Bootstring encoding of Unicode // for Internationalized Domain Names in Applications (IDNA) -static TQStringList splitLabels(const TQString& unicodeDomain) +static TQStringList splitLabels(const TQString& tqunicodeDomain) { // From RFC 3490 section 3.1: // "Whenever dots are used as label separators, the following characters @@ -1060,9 +1060,9 @@ static TQStringList splitLabels(const TQString& unicodeDomain) TQStringList lst; int start = 0; uint i; - for (i = 0; i < unicodeDomain.length(); i++) + for (i = 0; i < tqunicodeDomain.length(); i++) { - unsigned int c = unicodeDomain[i].unicode(); + unsigned int c = tqunicodeDomain[i].tqunicode(); if (c == separators[0] || c == separators[1] || @@ -1070,13 +1070,13 @@ static TQStringList splitLabels(const TQString& unicodeDomain) c == separators[3]) { // found a separator! - lst << unicodeDomain.mid(start, i - start); + lst << tqunicodeDomain.mid(start, i - start); start = i + 1; } } if ((long)i >= start) // there is still one left - lst << unicodeDomain.mid(start, i - start); + lst << tqunicodeDomain.mid(start, i - start); return lst; } @@ -1101,7 +1101,7 @@ static TQCString ToASCII(const TQString& label) uint i; for (i = 0; i < label.length(); i++) - ucs4[i] = (unsigned long)label[i].unicode(); + ucs4[i] = (unsigned long)label[i].tqunicode(); ucs4[i] = 0; // terminate with NUL, just to be on the safe side if (idna_to_ascii_4i(ucs4, label.length(), buf, 0) == IDNA_SUCCESS) @@ -1118,7 +1118,7 @@ static TQCString ToASCII(const TQString& label) static TQString ToUnicode(const TQString& label) { #ifdef HAVE_IDNA_H - // We have idna.h, so we can use the idna_to_unicode + // We have idna.h, so we can use the idna_to_tqunicode // function :) TQ_UINT32 *ucs4_input, *ucs4_output; @@ -1126,7 +1126,7 @@ static TQString ToUnicode(const TQString& label) ucs4_input = new TQ_UINT32[label.length() + 1]; for (uint i = 0; i < label.length(); i++) - ucs4_input[i] = (unsigned long)label[i].unicode(); + ucs4_input[i] = (unsigned long)label[i].tqunicode(); // try the same length for output ucs4_output = new TQ_UINT32[outlen = label.length()]; diff --git a/tdecore/network/kresolver.h b/tdecore/network/kresolver.h index e2e08623b..1b13d676b 100644 --- a/tdecore/network/kresolver.h +++ b/tdecore/network/kresolver.h @@ -796,11 +796,11 @@ public: * Note that the encoding is illegible and, thus, should not be presented * to the user, except if requested. * - * @param unicodeDomain the domain name to be encoded + * @param tqunicodeDomain the domain name to be encoded * @return the ACE-encoded suitable for DNS queries if successful, a null * TQCString if failure. */ - static TQCString domainToAscii(const TQString& unicodeDomain); + static TQCString domainToAscii(const TQString& tqunicodeDomain); /** * Does the inverse of @ref domainToAscii and return an Unicode domain diff --git a/tdecore/network/kresolverstandardworkers.cpp b/tdecore/network/kresolverstandardworkers.cpp index a6f4e4ec0..6236cc15d 100644 --- a/tdecore/network/kresolverstandardworkers.cpp +++ b/tdecore/network/kresolverstandardworkers.cpp @@ -140,7 +140,7 @@ bool KBlacklistWorker::isBlacklisted(const TQString& host) return false; // KDE4: QLatin1String - TQString ascii = TQString::fromLatin1(KResolver::domainToAscii(host)); + TQString ascii = TQString::tqfromLatin1(KResolver::domainToAscii(host)); TQMutexLocker locker(&blacklistMutex); @@ -251,7 +251,7 @@ namespace // check blacklist if (m_af != AF_INET && - KBlacklistWorker::isBlacklisted(TQString::fromLatin1(m_hostname))) + KBlacklistWorker::isBlacklisted(TQString::tqfromLatin1(m_hostname))) break; # ifdef USE_GETHOSTBYNAME2_R @@ -358,7 +358,7 @@ namespace if (socktype == 0) socktype = SOCK_STREAM; // default - TQString canon = KResolver::domainToUnicode(TQString::fromLatin1(he->h_name)); + TQString canon = KResolver::domainToUnicode(TQString::tqfromLatin1(he->h_name)); KInetSocketAddress sa; sa.setPort(m_port); if (he->h_addrtype != AF_INET) @@ -404,7 +404,7 @@ namespace { // check blacklist if ((m_af != AF_INET && m_af != AF_UNSPEC) && - KBlacklistWorker::isBlacklisted(TQString::fromLatin1(m_node))) + KBlacklistWorker::isBlacklisted(TQString::tqfromLatin1(m_node))) { results.setError(KResolver::NoName); finished(); @@ -550,8 +550,8 @@ bool KStandardWorker::sanityCheck() if (node.find('%') != -1) node.truncate(node.find('%')); - if (node.isEmpty() || node == TQString::fromLatin1("*") || - node == TQString::fromLatin1("localhost")) + if (node.isEmpty() || node == TQString::tqfromLatin1("*") || + node == TQString::tqfromLatin1("localhost")) m_encodedName.truncate(0); else { @@ -616,7 +616,7 @@ bool KStandardWorker::resolveService() // service name does not contain a port number // must be a name - if (serviceName().isEmpty() || serviceName().compare(TQString::fromLatin1("*")) == 0) + if (serviceName().isEmpty() || serviceName().compare(TQString::tqfromLatin1("*")) == 0) port = 0; else { @@ -712,7 +712,7 @@ bool KStandardWorker::resolveNumerically() // now try to resolve the hostname numerically KInetSocketAddress sa; setError(KResolver::NoError); - sa.setHost(KIpAddress(TQString::fromLatin1(m_encodedName))); + sa.setHost(KIpAddress(TQString::tqfromLatin1(m_encodedName))); // if it failed, the length was reset to 0 bool ok = sa.length() != 0; diff --git a/tdecore/network/kreverseresolver.cpp b/tdecore/network/kreverseresolver.cpp index 5c602458c..00ef7f81d 100644 --- a/tdecore/network/kreverseresolver.cpp +++ b/tdecore/network/kreverseresolver.cpp @@ -238,8 +238,8 @@ bool ReverseThread::run() if (err == 0) { - node = KResolver::domainToUnicode(TQString::fromLatin1(h)); - service = TQString::fromLatin1(s); + node = KResolver::domainToUnicode(TQString::tqfromLatin1(h)); + service = TQString::tqfromLatin1(s); success = true; } else diff --git a/tdecore/network/kserversocket.cpp b/tdecore/network/kserversocket.cpp index 49facb12c..bd63d6306 100644 --- a/tdecore/network/kserversocket.cpp +++ b/tdecore/network/kserversocket.cpp @@ -155,7 +155,7 @@ bool KServerSocket::lookup() // make sure we have at least one parameter for lookup if (d->resolver.serviceName().isNull() && !d->resolver.nodeName().isNull()) - d->resolver.setServiceName(TQString::fromLatin1("")); + d->resolver.setServiceName(TQString::tqfromLatin1("")); // don't restart the lookups if they had succeeded and // the input values weren't changed diff --git a/tdecore/network/ksocketaddress.cpp b/tdecore/network/ksocketaddress.cpp index 7ceeba99d..feaabfab5 100644 --- a/tdecore/network/ksocketaddress.cpp +++ b/tdecore/network/ksocketaddress.cpp @@ -165,7 +165,7 @@ bool KIpAddress::setAddress(const TQString& address) bool KIpAddress::setAddress(const char* address) { - return setAddress(TQString::fromLatin1(address)); + return setAddress(TQString::tqfromLatin1(address)); } // set from binary data @@ -194,13 +194,13 @@ TQString KIpAddress::toString() const { case 4: inet_ntop(AF_INET, m_data, buf, sizeof(buf) - 1); - return TQString::fromLatin1(buf); + return TQString::tqfromLatin1(buf); case 6: #ifdef AF_INET6 inet_ntop(AF_INET6, m_data, buf, sizeof(buf) - 1); #endif - return TQString::fromLatin1(buf); + return TQString::tqfromLatin1(buf); } return TQString::null; @@ -270,7 +270,7 @@ public: { addr.generic = 0L; curlen = 0; - invalidate(); + tqinvalidate(); } ~KSocketAddressData() @@ -282,7 +282,7 @@ public: inline bool invalid() const { return reallen == 0; } - inline void invalidate() + inline void tqinvalidate() { reallen = 0; } void dup(const sockaddr* sa, TQ_UINT16 len, bool clear = true); @@ -348,7 +348,7 @@ void KSocketAddressData::dup(const sockaddr* sa, TQ_UINT16 len, bool clear) if (len < MIN_SOCKADDR_LEN) { // certainly invalid - invalidate(); + tqinvalidate(); return; } @@ -359,7 +359,7 @@ void KSocketAddressData::dup(const sockaddr* sa, TQ_UINT16 len, bool clear) (sa->sa_family == AF_UNIX && len < MIN_SOCKADDR_UN_LEN))) { // also invalid - invalidate(); + tqinvalidate(); return; } @@ -444,7 +444,7 @@ KSocketAddress& KSocketAddress::operator =(const KSocketAddress& other) if (other.d && !other.d->invalid()) d->dup(other.d->addr.generic, other.d->reallen); else - d->invalidate(); + d->tqinvalidate(); return *this; } @@ -467,7 +467,7 @@ KSocketAddress& KSocketAddress::setAddress(const sockaddr* sa, TQ_UINT16 len) if (sa != 0L && len >= MIN_SOCKADDR_LEN) d->dup(sa, len); else - d->invalidate(); + d->tqinvalidate(); return *this; } @@ -619,7 +619,7 @@ TQString KSocketAddress::toString() const fmt = "[%1]:%2"; #endif else if (d->addr.generic->sa_family == AF_UNIX) - return TQString::fromLatin1("unix:%1").arg(serviceName()); + return TQString::tqfromLatin1("unix:%1").arg(serviceName()); else return i18n("1: the unknown socket address family number", "Unknown family %1").arg(d->addr.generic->sa_family); @@ -788,7 +788,7 @@ KInetSocketAddress& KInetSocketAddress::setHost(const KIpAddress& ip) default: // empty - d->invalidate(); + d->tqinvalidate(); } return *this; @@ -832,7 +832,7 @@ KInetSocketAddress& KInetSocketAddress::setPort(TQ_UINT16 port) #endif default: - d->invalidate(); // setting the port on something else + d->tqinvalidate(); // setting the port on something else } return *this; @@ -897,7 +897,7 @@ void KInetSocketAddress::update() return; #endif else - d->invalidate(); + d->tqinvalidate(); } KUnixSocketAddress::KUnixSocketAddress() @@ -908,7 +908,7 @@ KUnixSocketAddress::KUnixSocketAddress(const sockaddr* sa, TQ_UINT16 len) : KSocketAddress(sa, len) { if (!d->invalid() && d->addr.un->sun_family != AF_UNIX) - d->invalidate(); + d->tqinvalidate(); } KUnixSocketAddress::KUnixSocketAddress(const KUnixSocketAddress& other) diff --git a/tdecore/network/ksocketaddress.h b/tdecore/network/ksocketaddress.h index a57d11e82..d02a6984c 100644 --- a/tdecore/network/ksocketaddress.h +++ b/tdecore/network/ksocketaddress.h @@ -511,7 +511,7 @@ public: * buffer to fit needs. This function should not be used except for handling * unknown socket address structures. * - * Also note that this function may invalidate the socket if a known + * Also note that this function may tqinvalidate the socket if a known * family is set (Internet or Unix socket) and the new length would be * too small to hold the system's sockaddr_* structure. If unsure, reset * the family: @@ -535,7 +535,7 @@ public: /** * Sets the family of this object. * - * Note: setting the family will probably invalidate any address data + * Note: setting the family will probably tqinvalidate any address data * contained in this object. Use this function with care. * * @param family the new family to set diff --git a/tdecore/network/ksocketbase.cpp b/tdecore/network/ksocketbase.cpp index 8449dbdc8..f5410f3e8 100644 --- a/tdecore/network/ksocketbase.cpp +++ b/tdecore/network/ksocketbase.cpp @@ -309,7 +309,7 @@ int KActiveSocketBase::putch(int ch) void KActiveSocketBase::setError(int status, SocketError error) { KSocketBase::setError(error); - seStatus(status); + setqStatus(status); } void KActiveSocketBase::resetError() diff --git a/tdecore/network/ksrvresolverworker.cpp b/tdecore/network/ksrvresolverworker.cpp index f3166b982..2ec5bb4bf 100644 --- a/tdecore/network/ksrvresolverworker.cpp +++ b/tdecore/network/ksrvresolverworker.cpp @@ -54,8 +54,8 @@ bool KSrvResolverWorker::preprocess() if (node.find('%') != -1) node.truncate(node.find('%')); - if (node.isEmpty() || node == TQString::fromLatin1("*") || - node == TQString::fromLatin1("localhost")) + if (node.isEmpty() || node == TQString::tqfromLatin1("*") || + node == TQString::tqfromLatin1("localhost")) return false; // empty == localhost encodedName = KResolver::domainToAscii(node); @@ -85,7 +85,7 @@ bool KSrvResolverWorker::preprocess() return false; protoname = "_"; - protoname += names.at(0); + protoname += names.tqat(0); } else if (sockettype == SOCK_STREAM || sockettype == 0) protoname = "_tcp"; @@ -225,7 +225,7 @@ bool KSrvResolverWorker::postprocess() void KSrvResolverWorker::customEvent(TQCustomEvent*) { - dns = new TQDns(TQString::fromLatin1(encodedName), TQDns::Srv); + dns = new TQDns(TQString::tqfromLatin1(encodedName), TQDns::Srv); TQObject::connect(dns, TQT_SIGNAL(resultsReady()), this, TQT_SLOT(dnsResultsReady())); } -- cgit v1.2.1