summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorTasuku Suzuki <stasuku@gmail.com>2013-04-15 08:27:02 +0900
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-17 09:44:22 +0200
commitd9e722d8560c07adb1852cfd061ffb23197d06fd (patch)
tree32ead273ee4b8b4795819c0e7739fe4bc0080dcb /src/plugins/platforms/xcb
parentf730cd7542548d7d5fb7cd25f631e471697960c8 (diff)
Make qtbase compile with QT_NO_TEXTCODEC
Change-Id: I1614dc08c0dd1950020e415f37c97160431b2336 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbmime.cpp2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index 155b327315..f7c473de88 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -883,13 +883,19 @@ int QXcbKeyboard::keysymToQtKey(xcb_keysym_t key) const
int QXcbKeyboard::keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, QString text) const
{
int code = 0;
+#ifndef QT_NO_TEXTCODEC
QTextCodec *systemCodec = QTextCodec::codecForLocale();
+#endif
// Commentary in X11/keysymdef says that X codes match ASCII, so it
// is safe to use the locale functions to process X codes in ISO8859-1.
// This is mainly for compatibility - applications should not use the
// Qt keycodes between 128 and 255 (extended ACSII codes), but should
// rather use the QKeyEvent::text().
- if (keysym < 128 || (keysym < 256 && systemCodec->mibEnum() == 4)) {
+ if (keysym < 128 || (keysym < 256
+#ifndef QT_NO_TEXTCODEC
+ && systemCodec->mibEnum() == 4
+#endif
+ )) {
// upper-case key, if known
code = isprint((int)keysym) ? toupper((int)keysym) : 0;
} else if (keysym >= XK_F1 && keysym <= XK_F35) {
diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp
index bc8c559c6e..b205a63267 100644
--- a/src/plugins/platforms/xcb/qxcbmime.cpp
+++ b/src/plugins/platforms/xcb/qxcbmime.cpp
@@ -170,11 +170,13 @@ QVariant QXcbMime::mimeConvertToFormat(QXcbConnection *connection, xcb_atom_t a,
if (!encoding.isEmpty()
&& atomName == format + QLatin1String(";charset=") + QString::fromLatin1(encoding)) {
+#ifndef QT_NO_TEXTCODEC
if (requestedType == QVariant::String) {
QTextCodec *codec = QTextCodec::codecForName(encoding);
if (codec)
return codec->toUnicode(data);
}
+#endif
return data;
}