diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-01 16:19:03 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-01 16:19:03 (GMT) |
commit | 296b2f47b652c0f200b19bf556649b56efa6f26f (patch) | |
tree | 6f3801940ef328a70a22161abb77457ea51522e4 /src/gui/kernel | |
parent | 64ca7030df6189a0bc4df36473befd868c8d2ef6 (diff) | |
parent | e0fda52fde32458c4a42f04bd62b5e37f14c4bfd (diff) | |
download | Qt-296b2f47b652c0f200b19bf556649b56efa6f26f.zip Qt-296b2f47b652c0f200b19bf556649b56efa6f26f.tar.gz Qt-296b2f47b652c0f200b19bf556649b56efa6f26f.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/berlin-staging-1 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/berlin-staging-1:
optimization: get rid of QString::fromUtf16() usage
document QString::fromUtf16() slowness
remove duplicated calculation of length
remove pointless conditionals
micro-optimization
optimize qhash()
Designer/uic/related examples: Fix source code scanning issues II.
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qclipboard_s60.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qdnd_x11.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qmime_mac.cpp | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/kernel/qclipboard_s60.cpp b/src/gui/kernel/qclipboard_s60.cpp index 71c355b..f07e066 100644 --- a/src/gui/kernel/qclipboard_s60.cpp +++ b/src/gui/kernel/qclipboard_s60.cpp @@ -164,7 +164,8 @@ void readFromStreamLX(QMimeData* aData,RReadStream& aStream) TCardinality mimeTypeSize; aStream >> mimeTypeSize; HBufC* mimeTypeBuf = HBufC::NewLC(aStream,mimeTypeSize); - QString mimeType = QString::fromUtf16(mimeTypeBuf->Des().Ptr(),mimeTypeBuf->Length()); + QString mimeType = QString(reinterpret_cast<const QChar *>(mimeTypeBuf->Des().Ptr()), + mimeTypeBuf->Length()); CleanupStack::PopAndDestroy(mimeTypeBuf); // mime data TCardinality dataSize; diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp index edab6a0..33968bd 100644 --- a/src/gui/kernel/qdnd_x11.cpp +++ b/src/gui/kernel/qdnd_x11.cpp @@ -617,7 +617,7 @@ QVariant QX11Data::xdndMimeConvertToFormat(Atom a, const QByteArray &data, const // so it should be safe to check that the second char is 0 // to verify that it is utf16 if (data.size() > 1 && data.at(1) == 0) - return QString::fromUtf16(reinterpret_cast<const ushort *>(data.constData()), + return QString::fromRawData((const QChar *)data.constData(), data.size() / 2).split(QLatin1Char('\n')).first().toLatin1(); } } diff --git a/src/gui/kernel/qmime_mac.cpp b/src/gui/kernel/qmime_mac.cpp index 0431f2f..071f80d 100644 --- a/src/gui/kernel/qmime_mac.cpp +++ b/src/gui/kernel/qmime_mac.cpp @@ -431,8 +431,8 @@ QVariant QMacPasteboardMimeUnicodeText::convertToMime(const QString &mimetype, Q firstData.size(), CFStringGetSystemEncoding(), false)); ret = QString(str); } else if (flavor == QLatin1String("public.utf16-plain-text")) { - ret = QString::fromUtf16(reinterpret_cast<const ushort *>(firstData.constData()), - firstData.size() / sizeof(ushort)); + ret = QString(reinterpret_cast<const QChar *>(firstData.constData()), + firstData.size() / sizeof(QChar)); } else { qWarning("QMime::convertToMime: unhandled mimetype: %s", qPrintable(mimetype)); } |