summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstringbuilder.h
diff options
context:
space:
mode:
authorRobin Burchell <robin+qt@viroteck.net>2012-01-30 14:23:22 +0200
committerQt by Nokia <qt-info@nokia.com>2012-02-22 14:00:32 +0100
commit186692f81f2612c3cf3a4090cbf949f2fb1558f8 (patch)
treee4506e520a88a1c75086516a1edeb1ab2fb4d057 /src/corelib/tools/qstringbuilder.h
parent9d173c92183c30144e8bd4f115b2cd93c3da0d40 (diff)
Remove custom text codec for C strings.
This setting is extremely harmful, as code cannot know whether or not to expect it. It also made the behaviour of QString::fromAscii and ::toAscii unintuitive, and caused a lot of people to make mistakes with it. Change-Id: I2f429fa7ef93bd75bb93a7f64c56db15b7283388 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/tools/qstringbuilder.h')
-rw-r--r--src/corelib/tools/qstringbuilder.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h
index 5a4c27d22a..ebaaaa35c2 100644
--- a/src/corelib/tools/qstringbuilder.h
+++ b/src/corelib/tools/qstringbuilder.h
@@ -65,22 +65,12 @@ protected:
static void convertToAscii(const QChar *a, int len, char *&out);
static inline void convertFromAscii(char a, QChar *&out)
{
-#ifndef QT_NO_TEXTCODEC
- if (QString::codecForCStrings)
- *out++ = QChar::fromAscii(a);
- else
-#endif
- *out++ = QLatin1Char(a);
+ *out++ = QLatin1Char(a);
}
static inline void convertToAscii(QChar a, char *&out)
{
-#ifndef QT_NO_TEXTCODEC
- if (QString::codecForCStrings)
- *out++ = a.toAscii(); //###
- else
-#endif
- convertToLatin1(a, out);
+ convertToLatin1(a, out);
}
static inline void convertToLatin1(QChar a, char *&out)