diff options
author | axis <qt-info@nokia.com> | 2009-07-13 11:34:31 +0200 |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-07-13 11:34:31 +0200 |
commit | 77f82a242e33277290020f6e5c884b6197d73159 (patch) | |
tree | c24d06a616b04556e32b47dcedcbbfc11e905914 /src/gui/inputmethod/qcoefepinputcontext_s60.cpp | |
parent | 2ec096f3ea86a5572f5e5137ec76b7d9f275b405 (diff) |
Fixed a bug where input capabilities would not be updated.
Task: 257215
The capabilities would not be updated if the IM hints were the same.
We still try to avoid that when we can, but now we update the
capabilities if we really have to.
Diffstat (limited to 'src/gui/inputmethod/qcoefepinputcontext_s60.cpp')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index b15308087e..87f57e90a7 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -101,7 +101,7 @@ void QCoeFepInputContext::reset() void QCoeFepInputContext::update() { - updateHints(); + updateHints(false); // For pre-5.0 SDKs, we don't do text updates on S60 side. if (QSysInfo::s60Version() != QSysInfo::SV_S60_5_0) { @@ -120,7 +120,7 @@ void QCoeFepInputContext::setFocusWidget(QWidget *w) QInputContext::setFocusWidget(w); - updateHints(); + updateHints(true); } void QCoeFepInputContext::widgetDestroyed(QWidget *w) @@ -318,7 +318,7 @@ static QTextCharFormat qt_TCharFormat2QTextCharFormat(const TCharFormat &cFormat return qFormat; } -void QCoeFepInputContext::updateHints() +void QCoeFepInputContext::updateHints(bool mustUpdateInputCapabilities) { QWidget *w = focusWidget(); if (w) { @@ -326,10 +326,12 @@ void QCoeFepInputContext::updateHints() if (hints != m_lastImHints) { m_lastImHints = hints; applyHints(hints); + } else if (!mustUpdateInputCapabilities) { + // Optimization. Return immediately if there was no change. + return; } - } else { - CCoeEnv::Static()->InputCapabilitiesChanged(); } + CCoeEnv::Static()->InputCapabilitiesChanged(); } void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) @@ -449,8 +451,6 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) } else { m_textCapabilities = TCoeInputCapabilities::EAllText; } - - CCoeEnv::Static()->InputCapabilitiesChanged(); } void QCoeFepInputContext::applyFormat(QList<QInputMethodEvent::Attribute> *attributes) |