Commit 604f3c99 authored by ap's avatar ap

2006-08-28 Nikolas Zimmermann <zimmermann@kde.org>

        Reviewed and landed by ap.

        Fixes one chunk of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10604
        Offer QString -> DeprecatedString conversion.

        * platform/DeprecatedString.h:
        * platform/qt/StringQt.cpp:
        (WebCore::DeprecatedString::DeprecatedString):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16078 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1da64664
2006-08-28 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed and landed by ap.
Fixes one chunk of: http://bugzilla.opendarwin.org/show_bug.cgi?id=10604
Offer QString -> DeprecatedString conversion.
* platform/DeprecatedString.h:
* platform/qt/StringQt.cpp:
(WebCore::DeprecatedString::DeprecatedString):
2006-08-28 Nikolas Zimmermann <zimmermann@kde.org> 2006-08-28 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Tim Hatcher. Reviewed by Tim Hatcher.
......
...@@ -253,6 +253,7 @@ public: ...@@ -253,6 +253,7 @@ public:
operator KJS::UString() const; operator KJS::UString() const;
#if PLATFORM(QT) #if PLATFORM(QT)
DeprecatedString(const QString&);
operator QString() const; operator QString() const;
#endif #endif
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
namespace WebCore { namespace WebCore {
// String conversions
String::String(const QString& qstr) String::String(const QString& qstr)
{ {
unsigned int len = qstr.length(); unsigned int len = qstr.length();
...@@ -51,6 +52,17 @@ String::operator QString() const ...@@ -51,6 +52,17 @@ String::operator QString() const
return QString(reinterpret_cast<const QChar*>(characters()), length()); return QString(reinterpret_cast<const QChar*>(characters()), length());
} }
// DeprecatedString conversions
DeprecatedString::DeprecatedString(const QString& qstr)
{
if (qstr.isNull()) {
(*this) = DeprecatedString::null;
} else {
QByteArray utf8Data = qstr.toUtf8();
(*this) = DeprecatedString::fromUtf8(utf8Data.data(), utf8Data.length());
}
}
DeprecatedString::operator QString() const DeprecatedString::operator QString() const
{ {
return QString(reinterpret_cast<const QChar*>(unicode()), length()); return QString(reinterpret_cast<const QChar*>(unicode()), length());
......
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