Changeset 116637 in webkit


Ignore:
Timestamp:
May 10, 2012 6:19:08 AM (12 years ago)
Author:
alexis.menard@openbossa.org
Message:

[Qt] Avoid string conversions to construct a QUrl when using Qt5.
https://bugs.webkit.org/show_bug.cgi?id=86006

Reviewed by Kenneth Rohde Christiansen.

In Qt5, the QUrl constructor can handle the string directly, even in UTF-16 because the
constructor QUrl(QString) has been fixed. Unfortunately we still need to use the old
code path when building with Qt4.

No new tests : it's a performance improvement which should be covered by tests.

  • platform/qt/KURLQt.cpp:

(WebCore::KURL::operator QUrl):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116636 r116637  
     12012-05-10  Alexis Menard  <alexis.menard@openbossa.org>
     2
     3        [Qt] Avoid string conversions to construct a QUrl when using Qt5.
     4        https://bugs.webkit.org/show_bug.cgi?id=86006
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        In Qt5, the QUrl constructor can handle the string directly, even in UTF-16 because the
     9        constructor QUrl(QString) has been fixed. Unfortunately we still need to use the old
     10        code path when building with Qt4.
     11
     12        No new tests : it's a performance improvement which should be covered by tests.
     13
     14        * platform/qt/KURLQt.cpp:
     15        (WebCore::KURL::operator QUrl):
     16
    1172012-05-10  Noel Gordon  <noel.gordon@gmail.com>
    218
  • trunk/Source/WebCore/platform/qt/KURLQt.cpp

    r96779 r116637  
    3535KURL::operator QUrl() const
    3636{
     37#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
    3738    QString str = QString::fromRawData(reinterpret_cast<const QChar*>(m_string.characters()), m_string.length());
    3839    QByteArray ba = str.toUtf8();
     
    4041    QUrl url = QUrl::fromEncoded(ba);
    4142    return url;
     43#else
     44    return QUrl(m_string);
     45#endif
    4246}
    4347
Note: See TracChangeset for help on using the changeset viewer.