diff options
Diffstat (limited to 'kdecore/kurl.cpp')
-rw-r--r-- | kdecore/kurl.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/kdecore/kurl.cpp b/kdecore/kurl.cpp index 00ae675ea..cb396c3a5 100644 --- a/kdecore/kurl.cpp +++ b/kdecore/kurl.cpp @@ -172,14 +172,14 @@ static TQString lazy_encode( const TQString& segment, bool encodeAt=true ) for ( int i = 0; i < old_length; i++ ) { - unsigned int character = segment[i].tqunicode(); // Don't use latin1() + unsigned int character = segment[i].unicode(); // Don't use latin1() // It returns 0 for non-latin1 values // Small set of really ambiguous chars if ((character < 32) || // Low ASCII ((character == '%') && // The escape character itself (i+2 < old_length) && // But only if part of a valid escape sequence! - (hex2int(segment[i+1].tqunicode())!= -1) && - (hex2int(segment[i+2].tqunicode())!= -1)) || + (hex2int(segment[i+1].unicode())!= -1) && + (hex2int(segment[i+2].unicode())!= -1)) || (character == '?') || // Start of query delimiter ((character == '@') && encodeAt) || // Username delimiter (character == '#') || // Start of reference delimiter @@ -250,7 +250,7 @@ static void decode( const TQString& segment, TQString &decoded, TQString &encode { int a = i+1 < old_length ? hex2int( csegment[i] ) : -1; int b = i+1 < old_length ? hex2int( csegment[i+1] ) : -1; - if ((a == -1) || (b == -1)) // Only tqreplace if sequence is valid + if ((a == -1) || (b == -1)) // Only replace if sequence is valid { // Contains stray %, make sure to re-encode! bReencode = true; @@ -291,12 +291,12 @@ static void decode( const TQString& segment, TQString &decoded, TQString &encode { decoded = textCodec->toUnicode( new_segment ); if ( isRawURI ) { - int length = tqstrlen( new_segment ); + int length = qstrlen( new_segment ); while ( length < new_length ) { decoded += TQChar::null; length += 1; decoded += textCodec->toUnicode( new_segment + length ); - length += tqstrlen( new_segment + length ); + length += qstrlen( new_segment + length ); } } @@ -338,15 +338,15 @@ static TQString cleanpath(const TQString &_path, bool cleanDirSeparator, bool de #else TQString encodedDot("%2e"); #endif - if (path.tqfind(encodedDot, 0, false) != -1) + if (path.find(encodedDot, 0, false) != -1) { #ifndef KDE_QT_ONLY static const TQString &encodedDOT = KGlobal::staticQString("%2E"); // Uppercase! #else TQString encodedDOT("%2E"); #endif - path.tqreplace(encodedDot, "."); - path.tqreplace(encodedDOT, "."); + path.replace(encodedDot, "."); + path.replace(encodedDOT, "."); len = path.length(); } } @@ -365,7 +365,7 @@ static TQString cleanpath(const TQString &_path, bool cleanDirSeparator, bool de cdUp = 0; pos = orig_pos = len; - while ( pos && (pos = path.tqfindRev('/',--pos)) != -1 ) + while ( pos && (pos = path.findRev('/',--pos)) != -1 ) { len = orig_pos - pos - 1; if ( len == 2 && path[pos+1] == '.' && path[pos+2] == '.' ) @@ -404,7 +404,7 @@ bool KURL::isRelativeURL(const TQString &_url) { int len = _url.length(); if (!len) return true; // Very short relative URL. - const TQChar *str = _url.tqunicode(); + const TQChar *str = _url.unicode(); // Absolute URL must start with alpha-character if (!isalpha(str[0].latin1())) @@ -471,13 +471,13 @@ KURL::KURL( const TQString &url, int encoding_hint ) KURL::KURL( const char * url, int encoding_hint ) { reset(); - parse( TQString::tqfromLatin1(url), encoding_hint ); + parse( TQString::fromLatin1(url), encoding_hint ); } KURL::KURL( const TQCString& url, int encoding_hint ) { reset(); - parse( TQString::tqfromLatin1(url), encoding_hint ); + parse( TQString::fromLatin1(url), encoding_hint ); } KURL::KURL( const KURL& _u ) @@ -493,13 +493,13 @@ TQDataStream & operator<< (TQDataStream & s, const KURL & a) s << a.m_strProtocol << a.m_strUser << a.m_strPass << a.m_strHost << a.m_strPath << a.m_strPath_encoded << QueryForWire << a.m_strRef_encoded - << TQ_INT8(a.m_bIsMalformed ? 1 : 0) << a.m_iPort; + << Q_INT8(a.m_bIsMalformed ? 1 : 0) << a.m_iPort; return s; } TQDataStream & operator>> (TQDataStream & s, KURL & a) { - TQ_INT8 malf; + Q_INT8 malf; TQString QueryFromWire; s >> a.m_strProtocol >> a.m_strUser >> a.m_strPass >> a.m_strHost >> a.m_strPath >> a.m_strPath_encoded >> QueryFromWire >> a.m_strRef_encoded @@ -542,11 +542,11 @@ KURL::KURL( const KURL& _u, const TQString& _rel_url, int encoding_hint ) TQString rUrl = _rel_url; int len = _u.m_strProtocol.length(); if ( !_u.m_strHost.isEmpty() && !rUrl.isEmpty() && - rUrl.tqfind( _u.m_strProtocol, 0, false ) == 0 && + rUrl.find( _u.m_strProtocol, 0, false ) == 0 && rUrl[len] == ':' && (rUrl[len+1] != '/' || (rUrl[len+1] == '/' && rUrl[len+2] != '/')) ) { - rUrl.remove( 0, rUrl.tqfind( ':' ) + 1 ); + rUrl.remove( 0, rUrl.find( ':' ) + 1 ); } if ( rUrl.isEmpty() ) @@ -579,13 +579,13 @@ KURL::KURL( const KURL& _u, const TQString& _rel_url, int encoding_hint ) } else if ( rUrl[0] != '?' ) { - int pos = m_strPath.tqfindRev( '/' ); + int pos = m_strPath.findRev( '/' ); if (pos >= 0) m_strPath.truncate(pos); m_strPath += '/'; if (!m_strPath_encoded.isEmpty()) { - pos = m_strPath_encoded.tqfindRev( '/' ); + pos = m_strPath_encoded.findRev( '/' ); if (pos >= 0) m_strPath_encoded.truncate(pos); m_strPath_encoded += '/'; @@ -643,7 +643,7 @@ void KURL::parse( const TQString& _url, int encoding_hint ) return; } - const TQChar* buf = _url.tqunicode(); + const TQChar* buf = _url.unicode(); const TQChar* orig = buf; uint len = _url.length(); uint pos = 0; @@ -707,7 +707,7 @@ NodeErr: void KURL::parseRawURI( const TQString& _url, int encoding_hint ) { uint len = _url.length(); - const TQChar* buf = _url.tqunicode(); + const TQChar* buf = _url.unicode(); uint pos = 0; @@ -762,7 +762,7 @@ void KURL::parseURL( const TQString& _url, int encoding_hint ) bool badHostName = false; int start = 0; uint len = _url.length(); - const TQChar* buf = _url.tqunicode(); + const TQChar* buf = _url.unicode(); TQChar delim; TQString tmp; @@ -1040,7 +1040,7 @@ KURL& KURL::operator=( const TQString& _url ) KURL& KURL::operator=( const char * _url ) { reset(); - parse( TQString::tqfromLatin1(_url) ); + parse( TQString::fromLatin1(_url) ); return *this; } @@ -1231,7 +1231,7 @@ void KURL::setFileName( const TQString& _txt ) path = "/"; else { - int lastSlash = path.tqfindRev( '/' ); + int lastSlash = path.findRev( '/' ); if ( lastSlash == -1) { // The first character is not a '/' ??? @@ -1347,7 +1347,7 @@ void KURL::setEncodedPath( const TQString& _txt, int encoding_hint ) void KURL::setEncodedPathAndQuery( const TQString& _txt, int encoding_hint ) { - int pos = _txt.tqfind( '?' ); + int pos = _txt.find( '?' ); if ( pos == -1 ) { setEncodedPath(_txt, encoding_hint); @@ -1490,7 +1490,7 @@ TQString KURL::url( int _trailing, int encoding_hint ) const } if ( m_iUriMode == URL ) { - bool IPv6 = (m_strHost.tqfind(':') != -1); + bool IPv6 = (m_strHost.find(':') != -1); if (IPv6) u += '[' + m_strHost + ']'; else @@ -1546,7 +1546,7 @@ TQString KURL::prettyURL( int _trailing ) const } if ( m_iUriMode == URL ) { - bool IPv6 = (m_strHost.tqfind(':') != -1); + bool IPv6 = (m_strHost.find(':') != -1); if (IPv6) { u += '[' + m_strHost + ']'; @@ -1704,13 +1704,13 @@ TQString KURL::fileName( bool _strip_trailing_slash ) const // This is hairy, we need the last unencoded slash. // Count in the encoded string how many encoded slashes follow the last // unencoded one. - int i = m_strPath_encoded.tqfindRev( (QChar)'/', len - 1 ); + int i = m_strPath_encoded.findRev( (QChar)'/', len - 1 ); TQString fileName_encoded = m_strPath_encoded.mid(i+1); - n += fileName_encoded.tqcontains("%2f", false); + n += fileName_encoded.contains("%2f", false); } int i = len; do { - i = path.tqfindRev( (QChar)'/', i - 1 ); + i = path.findRev( (QChar)'/', i - 1 ); } while (--n && (i > 0)); @@ -1773,7 +1773,7 @@ TQString KURL::directory( bool _strip_trailing_slash_from_result, if ( result.isEmpty() || result == "/" ) return result; - int i = result.tqfindRev( "/" ); + int i = result.findRev( "/" ); // If ( i == -1 ) => the first character is not a '/' // So it's some URL like file:blah.tgz, with no path if ( i == -1 ) @@ -2143,17 +2143,17 @@ TQMap< TQString, TQString > KURL::queryItems( int options, int encoding_hint ) c TQMap< TQString, TQString > result; TQStringList items = TQStringList::split( '&', m_strQuery_encoded ); for ( TQStringList::const_iterator it = items.begin() ; it != items.end() ; ++it ) { - int equal_pos = (*it).tqfind( '=' ); + int equal_pos = (*it).find( '=' ); if ( equal_pos > 0 ) { // = is not the first char... TQString name = (*it).left( equal_pos ); if ( options & CaseInsensitiveKeys ) name = name.lower(); TQString value = (*it).mid( equal_pos + 1 ); if ( value.isEmpty() ) - result.insert( name, TQString::tqfromLatin1("") ); + result.insert( name, TQString::fromLatin1("") ); else { // ### why is decoding name not necessary? - value.tqreplace( '+', ' ' ); // + in queries means space + value.replace( '+', ' ' ); // + in queries means space result.insert( name, decode_string( value, encoding_hint ) ); } } else if ( equal_pos < 0 ) { // no = @@ -2187,11 +2187,11 @@ TQString KURL::queryItem( const TQString& _item, int encoding_hint ) const if ( (*it).length() > _len ) { TQString str = (*it).mid( _len ); - str.tqreplace( '+', ' ' ); // + in queries means space. + str.replace( '+', ' ' ); // + in queries means space. return decode_string( str, encoding_hint ); } else // empty value - return TQString::tqfromLatin1(""); + return TQString::fromLatin1(""); } } |