summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-07-13 09:34:31 (GMT)
committeraxis <qt-info@nokia.com>2009-07-13 09:34:31 (GMT)
commit77f82a242e33277290020f6e5c884b6197d73159 (patch)
treec24d06a616b04556e32b47dcedcbbfc11e905914 /src/gui/inputmethod
parent2ec096f3ea86a5572f5e5137ec76b7d9f275b405 (diff)
downloadQt-77f82a242e33277290020f6e5c884b6197d73159.zip
Qt-77f82a242e33277290020f6e5c884b6197d73159.tar.gz
Qt-77f82a242e33277290020f6e5c884b6197d73159.tar.bz2
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')
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h2
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp14
2 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index b33489e..7d20d24 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -93,7 +93,7 @@ public:
private:
void commitCurrentString(bool triggeredBySymbian);
- void updateHints();
+ void updateHints(bool mustUpdateInputCapabilities);
void applyHints(Qt::InputMethodHints hints);
void applyFormat(QList<QInputMethodEvent::Attribute> *attributes);
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index b153080..87f57e9 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)