diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-04-18 06:31:10 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-04-18 06:31:10 (GMT) |
commit | a4d33d8c3cd206b982962014323abb673f5c64e3 (patch) | |
tree | 2bd6a5e2b3dba061cdbb610c46789f78696063b3 /src/corelib/tools/qstringbuilder.cpp | |
parent | 45e3500d8a34bee9893eff95b494497d29f7a61b (diff) | |
parent | 6e74302238fbac8783eab36f7553eb30dc5ca352 (diff) | |
download | Qt-a4d33d8c3cd206b982962014323abb673f5c64e3.zip Qt-a4d33d8c3cd206b982962014323abb673f5c64e3.tar.gz Qt-a4d33d8c3cd206b982962014323abb673f5c64e3.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging: (163 commits)
QLocale: Fixed double to currency string conversion on Mac.
Fix qstringbuilder4 test on mac
Compile on Mac.
Revert "HTTP caching internals: fix logic for PreferNetwork and PreferCache"
Use the qt_static_metacall in QueuedConnection
Fix crash after merge of the native symbian thread branch.
Fix bad merge
Re-apply part of ba8e5eedf5f40091eb67dd391a7dcaf9299db2f5
Removed useless comment
SSL code: introduce new error value for blacklisted certificates
Disable DEF files by default for symbian-gcce.
HTTP caching internals: fix logic for PreferNetwork and PreferCache
Added a consistency check for number of missing symbols in elf2e32.
Updated def file after symbol removal.
QLocalSocket: fix abort on Windows.
QStringBuilder: add operator += for QString and QByteArray
Dummy commit to trigger pulse.
Fix QMetaObject::indexOfSlot
Fix compilation
Documentation for the initilize_list constructor
...
Diffstat (limited to 'src/corelib/tools/qstringbuilder.cpp')
-rw-r--r-- | src/corelib/tools/qstringbuilder.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp index 7d75de7..a5dff88 100644 --- a/src/corelib/tools/qstringbuilder.cpp +++ b/src/corelib/tools/qstringbuilder.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qstringbuilder.h" +#include <QtCore/qtextcodec.h> QT_BEGIN_NAMESPACE @@ -146,7 +147,9 @@ QT_BEGIN_NAMESPACE Converts the \c QLatin1Literal into a \c QString object. */ -/*! \internal */ +/*! \internal + Note: The len contains the ending \0 + */ void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out) { #ifndef QT_NO_TEXTCODEC @@ -166,4 +169,25 @@ void QAbstractConcatenable::convertFromAscii(const char *a, int len, QChar *&out } } +/*! \internal */ +void QAbstractConcatenable::convertToAscii(const QChar* a, int len, char*& out) +{ +#ifndef QT_NO_TEXTCODEC + if (QString::codecForCStrings) { + QByteArray tmp = QString::codecForCStrings->fromUnicode(a, len); + memcpy(out, tmp.constData(), tmp.size()); + out += tmp.length(); + return; + } +#endif + if (len == -1) { + while (a->unicode()) + convertToLatin1(*a++, out); + } else { + for (int i = 0; i < len; ++i) + convertToLatin1(a[i], out); + } +} + + QT_END_NAMESPACE |