diff options
author | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2010-04-06 10:36:47 (GMT) |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2010-04-06 10:36:47 (GMT) |
commit | bb35b65bbfba82e0dd0ac306d3dab54436cdaff6 (patch) | |
tree | 8174cb262a960ff7b2e4aa8f1aaf154db71d2636 /src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp | |
parent | 4b27d0d887269583a0f76e922948f8c25e96ab88 (diff) | |
download | Qt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.zip Qt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.tar.gz Qt-bb35b65bbfba82e0dd0ac306d3dab54436cdaff6.tar.bz2 |
Update src/3rdparty/webkit from trunk.
Imported from 839d8709327f925aacb3b6362c06152594def97e
in branch qtwebkit-2.0 of repository
git://gitorious.org/+qtwebkit-developers/webkit/qtwebkit.git
Rubber-stamped-by: Simon Hausmann
Diffstat (limited to 'src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp | 56 |
1 files changed, 2 insertions, 54 deletions
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp index 1f62006..72dea91 100644 --- a/src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp +++ b/src/3rdparty/webkit/WebCore/platform/qt/KURLQt.cpp @@ -27,14 +27,6 @@ namespace WebCore { -#if QT_VERSION < 0x040500 -static const char hexnumbers[] = "0123456789ABCDEF"; -static inline char toHex(char c) -{ - return hexnumbers[c & 0xf]; -} -#endif - KURL::KURL(const QUrl& url) { *this = KURL(KURL(), url.toEncoded().constData(), UTF8Encoding()); @@ -42,52 +34,8 @@ KURL::KURL(const QUrl& url) KURL::operator QUrl() const { -#if QT_VERSION < 0x040500 - unsigned length = m_string.length(); - - QByteArray ba; - ba.reserve(length); - - int path = -1; - int host = m_string.find("://"); - if (host != -1) { - host += 3; - - path = m_string.find('/', host); - } - - for (unsigned i = 0; i < length; ++i) { - const char chr = static_cast<char>(m_string[i]); - - switch (chr) { - encode: - case '{': - case '}': - case '|': - case '\\': - case '^': - case '`': - ba.append('%'); - ba.append(toHex((chr & 0xf0) >> 4)); - ba.append(toHex(chr & 0xf)); - break; - case '[': - case ']': - // special case: if this is the host part, don't encode - // otherwise, encode - if (host == -1 || (path != -1 && i >= path)) - goto encode; - // fall through - default: - ba.append(chr); - break; - } - } -#else - // Qt 4.5 or later - // No need for special encoding - QByteArray ba = m_string.utf8().data(); -#endif + QString str = QString::fromRawData(reinterpret_cast<const QChar*>(m_string.characters()), m_string.length()); + QByteArray ba = str.toUtf8(); QUrl url = QUrl::fromEncoded(ba); return url; |