summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2010-06-05 21:15:16 (GMT)
committerLars Knoll <lars.knoll@nokia.com>2010-06-09 22:08:28 (GMT)
commitda603c7c80ea14df18790ae77f5de82880307650 (patch)
tree9e1703c20595ecab1c0efe8f77b32f25996c60aa /src/gui/inputmethod
parent424735f91dbf5847640aca4011a309dbef7b1e31 (diff)
downloadQt-da603c7c80ea14df18790ae77f5de82880307650.zip
Qt-da603c7c80ea14df18790ae77f5de82880307650.tar.gz
Qt-da603c7c80ea14df18790ae77f5de82880307650.tar.bz2
Fixed some bugs in detection of keyboard directionality
The mapping table on X11 had a few bugs. Implemented rudimentary support on QWS and fixed a tiny issue on Mac. Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r--src/gui/inputmethod/qximinputcontext_x11.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/gui/inputmethod/qximinputcontext_x11.cpp b/src/gui/inputmethod/qximinputcontext_x11.cpp
index d048b36..88f8daf 100644
--- a/src/gui/inputmethod/qximinputcontext_x11.cpp
+++ b/src/gui/inputmethod/qximinputcontext_x11.cpp
@@ -346,10 +346,7 @@ static XFontSet getFontSet(const QFont &f)
extern bool qt_use_rtl_extensions; // from qapplication_x11.cpp
#ifndef QT_NO_XKB
-extern void q_getLocaleAndDirection(QLocale *locale,
- Qt::LayoutDirection *direction,
- const QByteArray &layoutName,
- const QByteArray &variantName);
+extern QLocale q_getKeyboardLocale(const QByteArray &layoutName, const QByteArray &variantName);
#endif
QXIMInputContext::QXIMInputContext()
@@ -407,17 +404,12 @@ QXIMInputContext::QXIMInputContext()
QList<QByteArray> layoutNames = QByteArray::fromRawData(names[2], qstrlen(names[2])).split(',');
QList<QByteArray> variantNames = QByteArray::fromRawData(names[3], qstrlen(names[3])).split(',');
for (int i = 0; i < qMin(layoutNames.count(), variantNames.count()); ++i ) {
- QLocale keyboardInputLocale;
- Qt::LayoutDirection keyboardInputDirection;
QByteArray variantName = variantNames.at(i);
const int dashPos = variantName.indexOf("-");
if (dashPos >= 0)
variantName.truncate(dashPos);
- q_getLocaleAndDirection(&keyboardInputLocale,
- &keyboardInputDirection,
- layoutNames.at(i),
- variantName);
- if (keyboardInputDirection == Qt::RightToLeft)
+ QLocale keyboardInputLocale = q_getKeyboardLocale(layoutNames.at(i), variantName);
+ if (keyboardInputLocale.isWrittenRightToLeft())
qt_use_rtl_extensions = true;
}
}