From 6e21bc798ba1066147d69dcc2d5c222ffafb9a90 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 10 Aug 2011 06:08:18 +0000 Subject: rename the following methods: tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kioslave/file/file.cc | 4 ++-- kioslave/ftp/ftp.cc | 12 +++++----- kioslave/http/http.cc | 28 +++++++++++------------ kioslave/http/kcookiejar/kcookiejar.cpp | 28 +++++++++++------------ kioslave/http/kcookiejar/kcookiewin.cpp | 2 +- kioslave/http/kcookiejar/tests/kcookiejartest.cpp | 4 ++-- kioslave/iso/iso.cpp | 2 +- 7 files changed, 40 insertions(+), 40 deletions(-) (limited to 'kioslave') diff --git a/kioslave/file/file.cc b/kioslave/file/file.cc index 88ba3b94d..d977bbd9c 100644 --- a/kioslave/file/file.cc +++ b/kioslave/file/file.cc @@ -960,7 +960,7 @@ void FileProtocol::del( const KURL& url, bool isfile) TQString FileProtocol::getUserName( uid_t uid ) { TQString *temp; - temp = usercache.tqfind( uid ); + temp = usercache.find( uid ); if ( !temp ) { struct passwd *user = getpwuid( uid ); if ( user ) { @@ -977,7 +977,7 @@ TQString FileProtocol::getUserName( uid_t uid ) TQString FileProtocol::getGroupName( gid_t gid ) { TQString *temp; - temp = groupcache.tqfind( gid ); + temp = groupcache.find( gid ); if ( !temp ) { struct group *grp = getgrgid( gid ); if ( grp ) { diff --git a/kioslave/ftp/ftp.cc b/kioslave/ftp/ftp.cc index 68bcf2064..e310930fe 100644 --- a/kioslave/ftp/ftp.cc +++ b/kioslave/ftp/ftp.cc @@ -693,8 +693,8 @@ bool Ftp::ftpLogin() } TQString sTmp = remoteEncoding()->decode( ftpResponse(3) ); - int iBeg = sTmp.tqfind('"'); - int iEnd = sTmp.tqfindRev('"'); + int iBeg = sTmp.find('"'); + int iEnd = sTmp.findRev('"'); if(iBeg > 0 && iBeg < iEnd) { m_initialPath = sTmp.mid(iBeg+1, iEnd-iBeg-1); @@ -749,7 +749,7 @@ bool Ftp::ftpSendCmd( const TQCString& cmd, int maxretries ) { assert(m_control != NULL); // must have control connection socket - if ( cmd.tqfind( '\r' ) != -1 || cmd.tqfind( '\n' ) != -1) + if ( cmd.find( '\r' ) != -1 || cmd.find( '\n' ) != -1) { kdWarning(7102) << "Invalid command received (contains CR or LF):" << cmd.data() << endl; @@ -1285,7 +1285,7 @@ bool Ftp::ftpRename( const TQString & src, const TQString & dst, bool overwrite return false; } - int pos = src.tqfindRev("/"); + int pos = src.findRev("/"); if( !ftpFolder(src.left(pos+1), false) ) return false; @@ -1838,7 +1838,7 @@ bool Ftp::ftpReadDir(FtpEntry& de) TQCString tmp( p_name ); if ( p_access[0] == 'l' ) { - int i = tmp.tqfindRev( " -> " ); + int i = tmp.findRev( " -> " ); if ( i != -1 ) { de.link = remoteEncoding()->decode(p_name + i + 4); tmp.truncate( i ); @@ -1852,7 +1852,7 @@ bool Ftp::ftpReadDir(FtpEntry& de) if ( tmp[0] == '/' ) // listing on ftp://ftp.gnupg.org/ starts with '/' tmp.remove( 0, 1 ); - if (tmp.tqfind('/') != -1) + if (tmp.find('/') != -1) continue; // Don't trick us! // Some sites put more than one space between the date and the name // e.g. ftp://ftp.uni-marburg.de/mirror/ diff --git a/kioslave/http/http.cc b/kioslave/http/http.cc index fa8997eca..3d957aaef 100644 --- a/kioslave/http/http.cc +++ b/kioslave/http/http.cc @@ -171,7 +171,7 @@ static TQString sanitizeCustomHTTPHeader(const TQString& _header) TQString header = (*it).lower(); // Do not allow Request line to be specified and ignore // the other HTTP headers. - if (header.tqfind(':') == -1 || + if (header.find(':') == -1 || header.startsWith("host") || header.startsWith("via")) continue; @@ -431,7 +431,7 @@ void HTTPProtocol::setHost( const TQString& host, int port, m_davHostOk = m_davHostUnsupported = false; // is it an IPv6 address? - if (host.tqfind(':') == -1) + if (host.find(':') == -1) { m_request.hostname = host; m_request.encoded_hostname = KIDNA::toAscii(host); @@ -439,7 +439,7 @@ void HTTPProtocol::setHost( const TQString& host, int port, else { m_request.hostname = host; - int pos = host.tqfind('%'); + int pos = host.find('%'); if (pos == -1) m_request.encoded_hostname = '[' + host + ']'; else @@ -828,8 +828,8 @@ void HTTPProtocol::davGeneric( const KURL& url, KIO::HTTP_METHOD method ) int HTTPProtocol::codeFromResponse( const TQString& response ) { - int firstSpace = response.tqfind( ' ' ); - int secondSpace = response.tqfind( ' ', firstSpace + 1 ); + int firstSpace = response.find( ' ' ); + int secondSpace = response.find( ' ', firstSpace + 1 ); return response.mid( firstSpace + 1, secondSpace - firstSpace - 1 ).toInt(); } @@ -3278,7 +3278,7 @@ try_again: // path, thus we extract the filename only. if ( !dispositionFilename.isEmpty() ) { - int pos = dispositionFilename.tqfindRev( '/' ); + int pos = dispositionFilename.findRev( '/' ); if( pos > -1 ) dispositionFilename = dispositionFilename.mid(pos+1); @@ -4680,12 +4680,12 @@ FILE* HTTPProtocol::checkCacheEntry( bool readWrite) TQString CEF = m_request.path; - int p = CEF.tqfind('/'); + int p = CEF.find('/'); while(p != -1) { CEF[p] = separator; - p = CEF.tqfind('/', p); + p = CEF.find('/', p); } TQString host = m_request.hostname.lower(); @@ -4875,7 +4875,7 @@ void HTTPProtocol::updateExpireDate(time_t expireDate, bool updateCreationDate) void HTTPProtocol::createCacheEntry( const TQString &mimetype, time_t expireDate) { TQString dir = m_request.cef; - int p = dir.tqfindRev('/'); + int p = dir.findRev('/'); if (p == -1) return; // Error. dir.truncate(p); @@ -5233,13 +5233,13 @@ bool HTTPProtocol::getAuthorization() { bool isStaleNonce = false; TQString auth = ( m_responseCode == 401 ) ? m_strAuthorization : m_strProxyAuthorization; - int pos = auth.tqfind("stale", 0, false); + int pos = auth.find("stale", 0, false); if ( pos != -1 ) { pos += 5; int len = auth.length(); while( pos < len && (auth[pos] == ' ' || auth[pos] == '=') ) pos++; - if ( pos < len && auth.tqfind("true", pos, false) != -1 ) + if ( pos < len && auth.find("true", pos, false) != -1 ) { isStaleNonce = true; kdDebug(7113) << "(" << m_pid << ") Stale nonce value. " @@ -5358,13 +5358,13 @@ bool HTTPProtocol::getAuthorization() else auth = m_strProxyAuthorization; - int pos = auth.tqfind("stale", 0, false); + int pos = auth.find("stale", 0, false); if ( pos != -1 ) { pos += 5; int len = auth.length(); while( pos < len && (auth[pos] == ' ' || auth[pos] == '=') ) pos++; - if ( pos < len && auth.tqfind("true", pos, false) != -1 ) + if ( pos < len && auth.find("true", pos, false) != -1 ) { info.digestInfo = (m_responseCode == 401) ? m_strAuthorization : m_strProxyAuthorization; kdDebug(7113) << "(" << m_pid << ") Just a stale nonce value! " @@ -5880,7 +5880,7 @@ TQString HTTPProtocol::createDigestAuth ( bool isForProxy ) TQCString uri = TQCString(p,i+1); do { - pos = uri.tqfind( ' ', idx ); + pos = uri.find( ' ', idx ); if ( pos != -1 ) { KURL u (m_request.url, uri.mid(idx, pos-idx)); diff --git a/kioslave/http/kcookiejar/kcookiejar.cpp b/kioslave/http/kcookiejar/kcookiejar.cpp index ca544ac62..136fba0b1 100644 --- a/kioslave/http/kcookiejar/kcookiejar.cpp +++ b/kioslave/http/kcookiejar/kcookiejar.cpp @@ -194,14 +194,14 @@ bool KHttpCookie::match(const TQString &fqdn, const TQStringList &domains, if (fqdn != mHost) return false; } - else if (!domains.tqcontains(mDomain)) + else if (!domains.contains(mDomain)) { if (mDomain[0] == '.') return false; // Maybe the domain needs an extra dot. TQString domain = '.' + mDomain; - if ( !domains.tqcontains( domain ) ) + if ( !domains.contains( domain ) ) if ( fqdn != mDomain ) return false; } @@ -261,7 +261,7 @@ KCookieJar::KCookieJar() for(TQStringList::ConstIterator it = countries.begin(); it != countries.end(); ++it) { - m_twoLevelTLD.tqreplace(*it, (int *) 1); + m_twoLevelTLD.replace(*it, (int *) 1); } } @@ -301,7 +301,7 @@ static void removeDuplicateFromList(KHttpCookieList *list, KHttpCookie *cookiePt it != cookie->windowIds().end(); ++it) { long windowId = *it; - if (windowId && (cookiePtr->windowIds().tqfind(windowId) == cookiePtr->windowIds().end())) + if (windowId && (cookiePtr->windowIds().find(windowId) == cookiePtr->windowIds().end())) { cookiePtr->windowIds().append(windowId); } @@ -337,8 +337,8 @@ TQString KCookieJar::findCookies(const TQString &_url, bool useDOMFormat, long w if (!parseURL(_url, fqdn, path)) return cookieStr; - bool secureRequest = (_url.tqfind( L1("https://"), 0, false) == 0 || - _url.tqfind( L1("webdavs://"), 0, false) == 0); + bool secureRequest = (_url.find( L1("https://"), 0, false) == 0 || + _url.find( L1("webdavs://"), 0, false) == 0); // kdDebug(7104) << "findCookies: URL= " << _url << ", secure = " << secureRequest << endl; @@ -399,7 +399,7 @@ TQString KCookieJar::findCookies(const TQString &_url, bool useDOMFormat, long w continue; } - if (windowId && (cookie->windowIds().tqfind(windowId) == cookie->windowIds().end())) + if (windowId && (cookie->windowIds().find(windowId) == cookie->windowIds().end())) { cookie->windowIds().append(windowId); } @@ -591,7 +591,7 @@ bool KCookieJar::parseURL(const TQString &_url, // Cookie spoofing protection. Since there is no way a path separator // or escape encoded character is allowed in the hostname according // to RFC 2396, reject attempts to include such things there! - if(_fqdn.tqfind('/') > -1 || _fqdn.tqfind('%') > -1) + if(_fqdn.find('/') > -1 || _fqdn.find('%') > -1) { return false; // deny everything!! } @@ -620,7 +620,7 @@ void KCookieJar::extractDomains(const TQString &_fqdn, // Return numeric IPv4 addresses as is... if ((_fqdn.tqat(0) >= TQChar('0')) && (_fqdn.tqat(0) <= TQChar('9'))) { - if (_fqdn.tqfind(TQRegExp(IP_ADDRESS_EXPRESSION)) > -1) + if (_fqdn.find(TQRegExp(IP_ADDRESS_EXPRESSION)) > -1) { _domains.append( _fqdn ); return; @@ -683,7 +683,7 @@ void KCookieJar::extractDomains(const TQString &_fqdn, */ static TQString fixupDateTime(const TQString& dt) { - const int index = dt.tqfind(TQRegExp("[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}")); + const int index = dt.find(TQRegExp("[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}")); if (index > -1) { @@ -729,7 +729,7 @@ KHttpCookieList KCookieJar::makeCookies(const TQString &_url, return KHttpCookieList(); } TQString defaultPath; - int i = path.tqfindRev('/'); + int i = path.findRev('/'); if (i > 0) defaultPath = path.left(i); @@ -811,7 +811,7 @@ KHttpCookieList KCookieJar::makeCookies(const TQString &_url, if(dom.length() > 2 && dom[dom.length()-1] == '.') dom = dom.left(dom.length()-1); - if(dom.tqcontains('.') > 1 || dom == ".local") + if(dom.contains('.') > 1 || dom == ".local") lastCookie->mDomain = dom; } else if (cName == "max-age") @@ -1020,7 +1020,7 @@ KCookieAdvice KCookieJar::cookieAdvice(KHttpCookiePtr cookiePtr) // cross-site cookie injection. if (!cookiePtr->domain().isEmpty()) { - if (!domains.tqcontains(cookiePtr->domain()) && + if (!domains.contains(cookiePtr->domain()) && !cookiePtr->domain().endsWith("."+cookiePtr->host())) cookiePtr->fixDomain(TQString::null); } @@ -1546,7 +1546,7 @@ void KCookieJar::loadConfig(KConfig *_config, bool reparse ) { const TQString &value = *it++; - int sepPos = value.tqfindRev(':'); + int sepPos = value.findRev(':'); if (sepPos <= 0) continue; diff --git a/kioslave/http/kcookiejar/kcookiewin.cpp b/kioslave/http/kcookiejar/kcookiewin.cpp index ca8560bf0..50477e40d 100644 --- a/kioslave/http/kcookiejar/kcookiewin.cpp +++ b/kioslave/http/kcookiejar/kcookiewin.cpp @@ -115,7 +115,7 @@ KCookieWin::KCookieWin( TQWidget *parent, KHttpCookieList cookieList, KHttpCookiePtr cookie = cookieList.first(); TQString host (cookie->host()); - int pos = host.tqfind(':'); + int pos = host.find(':'); if ( pos > 0 ) { TQString portNum = host.left(pos); diff --git a/kioslave/http/kcookiejar/tests/kcookiejartest.cpp b/kioslave/http/kcookiejar/tests/kcookiejartest.cpp index aa51b2f91..1ce1c4d8f 100644 --- a/kioslave/http/kcookiejar/tests/kcookiejartest.cpp +++ b/kioslave/http/kcookiejar/tests/kcookiejartest.cpp @@ -53,7 +53,7 @@ static void FAIL(const TQString &msg) static void popArg(TQCString &command, TQCString & line) { - int i = line.tqfind(' '); + int i = line.find(' '); if (i != -1) { command = line.left(i); @@ -69,7 +69,7 @@ static void popArg(TQCString &command, TQCString & line) static void popArg(TQString &command, TQCString & line) { - int i = line.tqfind(' '); + int i = line.find(' '); if (i != -1) { command = TQString::tqfromLatin1(line.left(i)); diff --git a/kioslave/iso/iso.cpp b/kioslave/iso/iso.cpp index 310e222c7..a772dafe5 100644 --- a/kioslave/iso/iso.cpp +++ b/kioslave/iso/iso.cpp @@ -130,7 +130,7 @@ bool kio_isoProtocol::checkNewFile( TQString fullPath, TQString & path, int star fullPath += '/'; kdDebug() << "the full path is " << fullPath << endl; - while ( (pos=fullPath.tqfind( '/', pos+1 )) != -1 ) + while ( (pos=fullPath.find( '/', pos+1 )) != -1 ) { TQString tryPath = fullPath.left( pos ); kdDebug() << fullPath << " trying " << tryPath << endl; -- cgit v1.2.1