summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm1
-rw-r--r--src/plugins/platforms/cocoa/qpaintengine_mac.mm1
-rw-r--r--src/plugins/platforms/xcb/qxcbmime.cpp2
-rw-r--r--src/plugins/sqldrivers/mysql/qsql_mysql.cpp20
4 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 94f2125bad..0035d30e36 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -56,7 +56,6 @@
#include <qbuffer.h>
#include <qdebug.h>
#include <qstringlist.h>
-#include <qtextcodec.h>
#include <qvarlengtharray.h>
#include <stdlib.h>
#include <qabstracteventdispatcher.h>
diff --git a/src/plugins/platforms/cocoa/qpaintengine_mac.mm b/src/plugins/platforms/cocoa/qpaintengine_mac.mm
index 3f363b62d5..f3629c2eb4 100644
--- a/src/plugins/platforms/cocoa/qpaintengine_mac.mm
+++ b/src/plugins/platforms/cocoa/qpaintengine_mac.mm
@@ -47,7 +47,6 @@
#include <private/qpaintengine_raster_p.h>
#include <qprinter.h>
#include <qstack.h>
-#include <qtextcodec.h>
#include <qwidget.h>
#include <qvarlengtharray.h>
#include <qdebug.h>
diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp
index 7170d259fd..d611f86a9c 100644
--- a/src/plugins/platforms/xcb/qxcbmime.cpp
+++ b/src/plugins/platforms/xcb/qxcbmime.cpp
@@ -168,7 +168,7 @@ QVariant QXcbMime::mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a,
if (!encoding.isEmpty()
&& atomName == format + QLatin1String(";charset=") + QLatin1String(encoding)) {
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
if (requestedType == QVariant::String) {
QTextCodec *codec = QTextCodec::codecForName(encoding);
if (codec)
diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
index 5a100b8075..49bceb88a0 100644
--- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
+++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp
@@ -48,7 +48,9 @@
#include <qsqlquery.h>
#include <qsqlrecord.h>
#include <qstringlist.h>
+#if QT_CONFIG(textcodec)
#include <qtextcodec.h>
+#endif
#include <qvector.h>
#include <qfile.h>
#include <qdebug.h>
@@ -82,7 +84,7 @@ class QMYSQLDriverPrivate : public QSqlDriverPrivate
public:
QMYSQLDriverPrivate() : QSqlDriverPrivate(), mysql(0),
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
tc(QTextCodec::codecForLocale()),
#else
tc(0),
@@ -96,7 +98,7 @@ public:
static inline QString toUnicode(QTextCodec *tc, const char *str)
{
-#ifdef QT_NO_TEXTCODEC
+#if !QT_CONFIG(textcodec)
Q_UNUSED(tc);
return QString::fromLatin1(str);
#else
@@ -106,7 +108,7 @@ static inline QString toUnicode(QTextCodec *tc, const char *str)
static inline QString toUnicode(QTextCodec *tc, const char *str, int length)
{
-#ifdef QT_NO_TEXTCODEC
+#if !QT_CONFIG(textcodec)
Q_UNUSED(tc);
return QString::fromLatin1(str, length);
#else
@@ -116,7 +118,7 @@ static inline QString toUnicode(QTextCodec *tc, const char *str, int length)
static inline QByteArray fromUnicode(QTextCodec *tc, const QString &str)
{
-#ifdef QT_NO_TEXTCODEC
+#if !QT_CONFIG(textcodec)
Q_UNUSED(tc);
return str.toLatin1();
#else
@@ -251,7 +253,7 @@ public:
bool preparedQuery;
};
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
static QTextCodec* codec(MYSQL* mysql)
{
#if MYSQL_VERSION_ID >= 32321
@@ -261,7 +263,7 @@ static QTextCodec* codec(MYSQL* mysql)
#endif
return QTextCodec::codecForLocale();
}
-#endif // QT_NO_TEXTCODEC
+#endif // textcodec
static QSqlError qMakeError(const QString& err, QSqlError::ErrorType type,
const QMYSQLDriverPrivate* p)
@@ -1199,7 +1201,7 @@ QMYSQLDriver::QMYSQLDriver(MYSQL * con, QObject * parent)
init();
if (con) {
d->mysql = (MYSQL *) con;
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
d->tc = codec(con);
#endif
setOpen(true);
@@ -1428,14 +1430,14 @@ bool QMYSQLDriver::open(const QString& db,
if (mysql_get_client_version() >= 50503 && mysql_get_server_version(d->mysql) >= 50503) {
// force the communication to be utf8mb4 (only utf8mb4 supports 4-byte characters)
mysql_set_character_set(d->mysql, "utf8mb4");
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
d->tc = QTextCodec::codecForName("UTF-8");
#endif
} else
{
// force the communication to be utf8
mysql_set_character_set(d->mysql, "utf8");
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
d->tc = codec(d->mysql);
#endif
}