-rw-r--r-- | microkde/kurl.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/microkde/kurl.cpp b/microkde/kurl.cpp index 2574e25..122ad71 100644 --- a/microkde/kurl.cpp +++ b/microkde/kurl.cpp @@ -36,3 +36,3 @@ #endif -#include <qurl.h> +#include <q3url.h> #include <qdir.h> @@ -43,2 +43,4 @@ #include <qtextcodec.h> +//Added by qt3to4: +#include <Q3CString> @@ -59,3 +61,3 @@ static QString encode( const QString& segment, bool encode_slash, int encoding_h - QCString local; + Q3CString local; if (encoding_hint==0) @@ -102,3 +104,3 @@ static QString encode( const QString& segment, bool encode_slash, int encoding_h else - new_segment[ new_length++ ] = local[i]; + new_segment[ new_length++ ] = character; } @@ -207,3 +209,3 @@ static void decode( const QString& segment, QString &decoded, QString &encoded, - QCString csegment = textCodec->fromUnicode(segment); + Q3CString csegment = textCodec->fromUnicode(segment); // Check if everything went ok @@ -280,3 +282,3 @@ static void decode( const QString& segment, QString &decoded, QString &encoded, array.resetRawData(new_segment, new_length); - QCString validate = textCodec->fromUnicode(decoded); + Q3CString validate = textCodec->fromUnicode(decoded); @@ -421,3 +423,3 @@ KURL::KURL( const char * url, int encoding_hint ) -KURL::KURL( const QCString& url, int encoding_hint ) +KURL::KURL( const Q3CString& url, int encoding_hint ) { @@ -462,3 +464,3 @@ QDataStream & operator>> (QDataStream & s, KURL & a) #ifndef QT_NO_NETWORKPROTOCOL -KURL::KURL( const QUrl &u ) +KURL::KURL( const Q3Url &u ) { @@ -591,3 +593,3 @@ void KURL::parse( const QString& _url, int encoding_hint ) goto Node9; - if ( !isalpha( (int)x ) ) + if ( !x.isLetter() ) goto NodeErr; @@ -597,3 +599,3 @@ void KURL::parse( const QString& _url, int encoding_hint ) // Proceed with :// :/ or : - while( pos < len && (isalpha((int)buf[pos]) || isdigit((int)buf[pos]) || + while( pos < len && ( buf[pos].isLetter() || buf[pos].isDigit() || buf[pos] == '+' || buf[pos] == '-')) pos++; @@ -771,3 +773,3 @@ void KURL::parse( const QString& _url, int encoding_hint ) start = pos; - if ( !isdigit( buf[pos++] ) ) + if ( !buf[pos++].isDigit() ) goto NodeErr; @@ -775,3 +777,3 @@ void KURL::parse( const QString& _url, int encoding_hint ) // Node 8b: Accept any amount of digits - while( pos < len && isdigit( buf[pos] ) ) pos++; + while( pos < len && buf[pos].isDigit() ) pos++; port = QString( buf + start, pos - start ); @@ -850,3 +852,3 @@ KURL& KURL::operator=( const char * _url ) #ifndef QT_NO_NETWORKPROTOCOL -KURL& KURL::operator=( const QUrl & u ) +KURL& KURL::operator=( const Q3Url & u ) { @@ -1376,3 +1378,3 @@ KURL KURL::join( const KURL::List & lst ) { - if (!u.m_strRef_encoded) u.m_strRef_encoded = tmp.url(); + if (u.m_strRef_encoded.isEmpty()) u.m_strRef_encoded = tmp.url(); else u.m_strRef_encoded += "#" + tmp.url(); // Support more than one suburl thingy @@ -1420,3 +1422,3 @@ QString KURL::fileName( bool _strip_trailing_slash ) const QString fileName_encoded = m_strPath_encoded.mid(i+1); - n += fileName_encoded.contains("%2f", false); + n += fileName_encoded.count("%2f", Qt::CaseInsensitive); } |