Commit 9de0494f authored by zecke@webkit.org's avatar zecke@webkit.org

[Qt] Speed up KURL to QUrl conversion

https://bugs.webkit.org/show_bug.cgi?id=33873

The WebCore::String::utf8 method will use the generic WebCore::TextCodec
and then call the encode method on it. In QtWebKit this class is implemented
around the QTextCodec class. Instead of going the generic codec way we treat
the WebCore::String as a QString (no copying) and then use the built-in
QString::toUtf8 to do the conversion.

git-svn-id: svn://svn.chromium.org/blink/trunk@53995 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 1530d220
2010-01-18 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Eric Seidel.
[Qt] Speed up KURL to QUrl conversion
https://bugs.webkit.org/show_bug.cgi?id=33873
The WebCore::String::utf8 method will use the generic WebCore::TextCodec
and then call the encode method on it. In QtWebKit this class is implemented
around the QTextCodec class. Instead of going the generic codec way we treat
the WebCore::String as a QString (no copying) and then use the built-in
QString::toUtf8 to do the conversion.
* platform/qt/KURLQt.cpp:
(WebCore::KURL::operator QUrl):
2010-01-28 Ben Murdoch <benm@google.com> 2010-01-28 Ben Murdoch <benm@google.com>
Reviewed by Simon Hausmann. Reviewed by Simon Hausmann.
...@@ -86,7 +86,8 @@ KURL::operator QUrl() const ...@@ -86,7 +86,8 @@ KURL::operator QUrl() const
#else #else
// Qt 4.5 or later // Qt 4.5 or later
// No need for special encoding // No need for special encoding
QByteArray ba = m_string.utf8().data(); QString str = QString::fromRawData(reinterpret_cast<const QChar*>(m_string.characters()), m_string.length());
QByteArray ba = str.toUtf8();
#endif #endif
QUrl url = QUrl::fromEncoded(ba); QUrl url = QUrl::fromEncoded(ba);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment