From 1abf2d6dfafc71f73746b7e69e11e0c8152edb4a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 10 Jun 2010 00:05:07 +0200 Subject: Rename QLocale::isWrittenRightToLeft() to textDirection() This is more in line with the rest of Qt. Reviewed-by: Simon Hausmann --- src/corelib/tools/qlocale.cpp | 8 ++++---- src/corelib/tools/qlocale.h | 2 +- src/gui/inputmethod/qximinputcontext_x11.cpp | 2 +- src/gui/kernel/qkeymapper_mac.cpp | 2 +- src/gui/kernel/qkeymapper_qws.cpp | 2 +- src/gui/kernel/qkeymapper_x11.cpp | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 8f50f2e..a51ee81 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -3480,9 +3480,9 @@ QLocale::MeasurementSystem QLocale::measurementSystem() const /*! \since 4.7 - Returns true if the language is written right to left. + Returns the text direction of the language. */ -bool QLocale::isWrittenRightToLeft() const +Qt::LayoutDirection QLocale::textDirection() const { Language lang = language(); if (lang == QLocale::Arabic || @@ -3490,9 +3490,9 @@ bool QLocale::isWrittenRightToLeft() const lang == QLocale::Persian || lang == QLocale::Urdu || lang == QLocale::Syriac) - return true; + return Qt::RightToLeft; - return false; + return Qt::LeftToRight; } diff --git a/src/corelib/tools/qlocale.h b/src/corelib/tools/qlocale.h index f8b5c55..8b424bb 100644 --- a/src/corelib/tools/qlocale.h +++ b/src/corelib/tools/qlocale.h @@ -666,7 +666,7 @@ public: MeasurementSystem measurementSystem() const; - bool isWrittenRightToLeft() const; + Qt::LayoutDirection textDirection() const; inline bool operator==(const QLocale &other) const; inline bool operator!=(const QLocale &other) const; diff --git a/src/gui/inputmethod/qximinputcontext_x11.cpp b/src/gui/inputmethod/qximinputcontext_x11.cpp index 88f8daf..ed5aa23 100644 --- a/src/gui/inputmethod/qximinputcontext_x11.cpp +++ b/src/gui/inputmethod/qximinputcontext_x11.cpp @@ -409,7 +409,7 @@ QXIMInputContext::QXIMInputContext() if (dashPos >= 0) variantName.truncate(dashPos); QLocale keyboardInputLocale = q_getKeyboardLocale(layoutNames.at(i), variantName); - if (keyboardInputLocale.isWrittenRightToLeft()) + if (keyboardInputLocale.textDirection() == Qt::RightToLeft) qt_use_rtl_extensions = true; } } diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp index 885f5ba..873b8f9 100644 --- a/src/gui/kernel/qkeymapper_mac.cpp +++ b/src/gui/kernel/qkeymapper_mac.cpp @@ -672,7 +672,7 @@ QKeyMapperPrivate::updateKeyboard() #endif if (iso639Code) { keyboardInputLocale = QLocale(QCFString::toQString(iso639Code)); - keyboardInputDirection = keyboardInputLocale.isWrittenRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight; + keyboardInputDirection = keyboardInputLocale.textDirection(); } else { keyboardInputLocale = QLocale::c(); keyboardInputDirection = Qt::LeftToRight; diff --git a/src/gui/kernel/qkeymapper_qws.cpp b/src/gui/kernel/qkeymapper_qws.cpp index 0e9f35a..63bb46b 100644 --- a/src/gui/kernel/qkeymapper_qws.cpp +++ b/src/gui/kernel/qkeymapper_qws.cpp @@ -52,7 +52,7 @@ QT_USE_NAMESPACE QKeyMapperPrivate::QKeyMapperPrivate() { keyboardInputLocale = QLocale::system(); - keyboardInputDirection = keyboardInputLocale.isWrittenRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight; + keyboardInputDirection = keyboardInputLocale.textDirection(); } QKeyMapperPrivate::~QKeyMapperPrivate() diff --git a/src/gui/kernel/qkeymapper_x11.cpp b/src/gui/kernel/qkeymapper_x11.cpp index f0d548c..825edbc 100644 --- a/src/gui/kernel/qkeymapper_x11.cpp +++ b/src/gui/kernel/qkeymapper_x11.cpp @@ -517,7 +517,7 @@ void QKeyMapperPrivate::clearMappings() // qWarning("Qt: unable to determine keyboard layout, please talk to qt-bugs@trolltech.com"); ? keyboardInputLocale = q_getKeyboardLocale(layoutName, variantName); - keyboardInputDirection = keyboardInputLocale.isWrittenRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight; + keyboardInputDirection = keyboardInputLocale.textDirection(); #if 0 qDebug() << "keyboard input locale =" -- cgit v0.12