aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp b/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp
index fbceceb9..10f2c0dc 100644
--- a/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp
+++ b/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp
@@ -295,15 +295,6 @@ public:
&QVirtualKeyboardDictionaryManager::activeDictionariesChanged,
this, &T9WriteInputMethodPrivate::onActiveDynamicDictionariesChanged);
- onAvailableDynamicDictionariesChanged();
- onActiveDynamicDictionariesChanged();
-
- const Qt::InputMethodHints inputMethodHints = q->inputContext()->inputMethodHints();
- if (!inputMethodHints.testFlag(Qt::ImhHiddenText) && !inputMethodHints.testFlag(Qt::ImhNoPredictiveText) &&
- !inputMethodHints.testFlag(Qt::ImhSensitiveData)) {
- dlmActivate();
- }
-
#ifdef HAVE_XT9
bindSettings();
#endif
@@ -468,13 +459,17 @@ public:
defaultDictionaryDisabledChangedConnection = QObjectPrivate::connect(
Settings::instance(), &Settings::defaultDictionaryDisabledChanged,
this, &T9WriteInputMethodPrivate::onDefaultDictionaryDisabledChanged);
-
+ if (!userDataResetConnection)
+ userDataResetConnection = QObjectPrivate::connect(
+ Settings::instance(), &Settings::userDataReset,
+ this, &T9WriteInputMethodPrivate::onUserDataReset);
}
void unbindSettings()
{
QObject::disconnect(defaultInputMethodDisabledChangedConnection);
QObject::disconnect(defaultDictionaryDisabledChangedConnection);
+ QObject::disconnect(userDataResetConnection);
}
void onXt9AlphabeticCoreDisabledChanged()
@@ -503,6 +498,14 @@ public:
xt9AwIme->setLdbEnabled(!Settings::instance()->isDefaultDictionaryDisabled());
}
+ void onUserDataReset()
+ {
+ dlmDeactivate();
+#ifdef HAVE_XT9
+ xt9Exit();
+#endif
+ }
+
ET9STATUS request(ET9_Request *const pRequest) override
{
Q_Q(T9WriteInputMethod);
@@ -760,6 +763,15 @@ public:
return false;
}
+ onAvailableDynamicDictionariesChanged();
+ onActiveDynamicDictionariesChanged();
+
+ const Qt::InputMethodHints inputMethodHints = q->inputContext()->inputMethodHints();
+ if (!inputMethodHints.testFlag(Qt::ImhHiddenText) && !inputMethodHints.testFlag(Qt::ImhNoPredictiveText) &&
+ !inputMethodHints.testFlag(Qt::ImhSensitiveData)) {
+ dlmActivate();
+ }
+
int isLanguageSupported = 0;
DECUMA_API(DatabaseIsLanguageSupported)(sessionSettings.pStaticDB, language, &isLanguageSupported);
if (!isLanguageSupported) {
@@ -2351,6 +2363,7 @@ public:
QMetaObject::Connection defaultInputMethodDisabledChangedConnection;
QMetaObject::Connection defaultDictionaryDisabledChangedConnection;
#endif
+ QMetaObject::Connection userDataResetConnection;
};
const DECUMA_MEM_FUNCTIONS T9WriteInputMethodPrivate::memFuncs = {