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: https://svn.webkit.org/repository/webkit/trunk@16078
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+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>
Reviewed by Tim Hatcher.
operator KJS::UString() const;
#if PLATFORM(QT)
+ DeprecatedString(const QString&);
operator QString() const;
#endif
namespace WebCore {
+// String conversions
String::String(const QString& qstr)
{
unsigned int len = qstr.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
{
return QString(reinterpret_cast<const QChar*>(unicode()), length());