summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/network/qftp/sym_iap_util.h2
-rw-r--r--src/corelib/io/qprocess_unix.cpp2
-rw-r--r--src/corelib/kernel/qcore_symbian_p.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp3
-rw-r--r--src/corelib/kernel/qtranslator.cpp2
-rw-r--r--src/corelib/tools/qstring.cpp4
-rw-r--r--src/gui/itemviews/qitemdelegate.cpp2
-rw-r--r--src/gui/kernel/qclipboard_s60.cpp3
-rw-r--r--src/gui/kernel/qdnd_x11.cpp2
-rw-r--r--src/gui/kernel/qmime_mac.cpp4
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp4
-rw-r--r--src/sql/kernel/qsqlresult.cpp2
-rw-r--r--tools/linguist/shared/qm.cpp2
13 files changed, 18 insertions, 16 deletions
diff --git a/examples/network/qftp/sym_iap_util.h b/examples/network/qftp/sym_iap_util.h
index 8079d2c..41e43a9 100644
--- a/examples/network/qftp/sym_iap_util.h
+++ b/examples/network/qftp/sym_iap_util.h
@@ -298,7 +298,7 @@ QString qt_TDesC2QStringL(const TDesC& aDescriptor)
#ifdef QT_NO_UNICODE
return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length());
#else
- return QString::fromUtf16(aDescriptor.Ptr(), aDescriptor.Length());
+ return QString((const QChar *)aDescriptor.Ptr(), aDescriptor.Length());
#endif
}
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 0bf7d3f..5119ec0 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -783,7 +783,7 @@ bool QProcessPrivate::processStarted()
// did we read an error message?
if (i > 0)
- q_func()->setErrorString(QString::fromUtf16(buf, i / sizeof(QChar)));
+ q_func()->setErrorString(QString((const QChar *)buf, i / sizeof(QChar)));
return i <= 0;
}
diff --git a/src/corelib/kernel/qcore_symbian_p.cpp b/src/corelib/kernel/qcore_symbian_p.cpp
index 5d2a6a5..0257ac4 100644
--- a/src/corelib/kernel/qcore_symbian_p.cpp
+++ b/src/corelib/kernel/qcore_symbian_p.cpp
@@ -71,7 +71,7 @@ Q_CORE_EXPORT QString qt_TDesC2QString(const TDesC& aDescriptor)
#ifdef QT_NO_UNICODE
return QString::fromLocal8Bit(aDescriptor.Ptr(), aDescriptor.Length());
#else
- return QString::fromUtf16(aDescriptor.Ptr(), aDescriptor.Length());
+ return QString(reinterpret_cast<const QChar *>(aDescriptor.Ptr()), aDescriptor.Length());
#endif
}
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 005dedc..5c65416 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2219,7 +2219,8 @@ QStringList QCoreApplication::libraryPaths()
TFindFile finder(fs);
TInt err = finder.FindByDir(tempPathPtr, tempPathPtr);
while (err == KErrNone) {
- QString foundDir = QString::fromUtf16(finder.File().Ptr(), finder.File().Length());
+ QString foundDir(reinterpret_cast<const QChar *>(finder.File().Ptr()),
+ finder.File().Length());
foundDir = QDir(foundDir).canonicalPath();
if (!app_libpaths->contains(foundDir))
app_libpaths->append(foundDir);
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index b7e6ea0..7d1e1d3 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -633,7 +633,7 @@ static QString getMessage(const uchar *m, const uchar *end, const char *context,
end:
if (!tn)
return QString();
- QString str = QString::fromUtf16((const ushort *)tn, tn_length/2);
+ QString str = QString((const QChar *)tn, tn_length/2);
if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
for (int i = 0; i < str.length(); ++i)
str[i] = QChar((str.at(i).unicode() >> 8) + ((str.at(i).unicode() << 8) & 0xff00));
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 44e4d16..3388500 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -885,7 +885,7 @@ int QString::grow(int size)
QString QString::fromWCharArray(const wchar_t *string, int size)
{
if (sizeof(wchar_t) == sizeof(QChar)) {
- return fromUtf16((ushort *)string, size);
+ return QString((const QChar *)string, size);
} else {
return fromUcs4((uint *)string, size);
}
@@ -7751,7 +7751,7 @@ QString QStringRef::toString() const {
return QString();
if (m_size && m_position == 0 && m_size == m_string->size())
return *m_string;
- return QString::fromUtf16(reinterpret_cast<const ushort*>(m_string->unicode() + m_position), m_size);
+ return QString(m_string->unicode() + m_position, m_size);
}
diff --git a/src/gui/itemviews/qitemdelegate.cpp b/src/gui/itemviews/qitemdelegate.cpp
index 6fd26a7..9069ce4 100644
--- a/src/gui/itemviews/qitemdelegate.cpp
+++ b/src/gui/itemviews/qitemdelegate.cpp
@@ -1033,7 +1033,7 @@ static QString qPixmapSerial(quint64 i, bool enabled)
i >>= 4;
}
- return QString::fromUtf16(ptr, int(&arr[sizeof(arr) / sizeof(ushort)] - ptr));
+ return QString((const QChar *)ptr, int(&arr[sizeof(arr) / sizeof(ushort)] - ptr));
}
/*!
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));
}
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index 9dbefaf..9fff552 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -245,9 +245,9 @@ bool QSQLiteResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int i
values[i + idx] = QVariant(QVariant::String);
break;
default:
- values[i + idx] = QString::fromUtf16(static_cast<const ushort *>(
+ values[i + idx] = QString(reinterpret_cast<const QChar *>(
sqlite3_column_text16(stmt, i)),
- sqlite3_column_bytes16(stmt, i) / sizeof(ushort));
+ sqlite3_column_bytes16(stmt, i) / sizeof(QChar));
break;
}
}
diff --git a/src/sql/kernel/qsqlresult.cpp b/src/sql/kernel/qsqlresult.cpp
index 5f12b55..3d63f88 100644
--- a/src/sql/kernel/qsqlresult.cpp
+++ b/src/sql/kernel/qsqlresult.cpp
@@ -136,7 +136,7 @@ static QString qFieldSerial(int i)
i >>= 4;
}
- return QString::fromUtf16(arr, int(ptr - arr) + 1);
+ return QString(reinterpret_cast<const QChar *>(arr), int(ptr - arr) + 1);
}
static bool qIsAlnum(QChar ch)
diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp
index 8118576..de1284f 100644
--- a/tools/linguist/shared/qm.cpp
+++ b/tools/linguist/shared/qm.cpp
@@ -594,7 +594,7 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd)
return false;
}
m += 4;
- QString str = QString::fromUtf16((const ushort *)m, len/2);
+ QString str = QString((const QChar *)m, len/2);
if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
for (int i = 0; i < str.length(); ++i)
str[i] = QChar((str.at(i).unicode() >> 8) +