summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbkeyboard.cpp
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/qxcbkeyboard.cpp
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/qxcbkeyboard.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp8
1 files changed, 7 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) {