diff options
-rw-r--r-- | src/virtualkeyboard/hunspellinputmethod.cpp | 2 | ||||
-rw-r--r-- | src/virtualkeyboard/hunspellinputmethod_p.cpp | 1 | ||||
-rw-r--r-- | src/virtualkeyboard/hunspellworker.cpp | 3 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/virtualkeyboard/hunspellinputmethod.cpp b/src/virtualkeyboard/hunspellinputmethod.cpp index 5cd88c2e..be1a8ce9 100644 --- a/src/virtualkeyboard/hunspellinputmethod.cpp +++ b/src/virtualkeyboard/hunspellinputmethod.cpp @@ -163,7 +163,7 @@ QList<SelectionListModel::Type> HunspellInputMethod::selectionLists() { Q_D(const HunspellInputMethod); Qt::InputMethodHints inputMethodHints = inputContext()->inputMethodHints(); - if (d->dictionaryState != HunspellInputMethodPrivate::DictionaryReady || inputMethodHints.testFlag(Qt::ImhNoPredictiveText) || inputMethodHints.testFlag(Qt::ImhHiddenText)) + if (d->dictionaryState == HunspellInputMethodPrivate::DictionaryNotLoaded || inputMethodHints.testFlag(Qt::ImhNoPredictiveText) || inputMethodHints.testFlag(Qt::ImhHiddenText)) return QList<SelectionListModel::Type>(); return QList<SelectionListModel::Type>() << SelectionListModel::WordCandidateList; } diff --git a/src/virtualkeyboard/hunspellinputmethod_p.cpp b/src/virtualkeyboard/hunspellinputmethod_p.cpp index 2512337d..90a60dd5 100644 --- a/src/virtualkeyboard/hunspellinputmethod_p.cpp +++ b/src/virtualkeyboard/hunspellinputmethod_p.cpp @@ -94,6 +94,7 @@ bool HunspellInputMethodPrivate::createHunspell(const QString &locale) QSharedPointer<HunspellLoadDictionaryTask> loadDictionaryTask(new HunspellLoadDictionaryTask(locale, searchPaths)); QObject::connect(loadDictionaryTask.data(), &HunspellLoadDictionaryTask::completed, q, &HunspellInputMethod::dictionaryLoadCompleted); dictionaryState = HunspellInputMethodPrivate::DictionaryLoading; + emit q->selectionListsChanged(); hunspellWorker->addTask(loadDictionaryTask); this->locale = locale; } diff --git a/src/virtualkeyboard/hunspellworker.cpp b/src/virtualkeyboard/hunspellworker.cpp index 1a6d18ef..ff937578 100644 --- a/src/virtualkeyboard/hunspellworker.cpp +++ b/src/virtualkeyboard/hunspellworker.cpp @@ -89,7 +89,6 @@ void HunspellLoadDictionaryTask::run() } if (!affPath.isEmpty() && !dicPath.isEmpty()) { - VIRTUALKEYBOARD_DEBUG() << "Hunspell dictionary is missing for the" << locale << "language. Search paths" << searchPaths; *hunspellPtr = Hunspell_create(affPath.toUtf8().constData(), dicPath.toUtf8().constData()); if (*hunspellPtr) { /* Make sure the encoding used by the dictionary is supported @@ -105,6 +104,8 @@ void HunspellLoadDictionaryTask::run() #ifdef QT_VIRTUALKEYBOARD_DEBUG VIRTUALKEYBOARD_DEBUG() << "HunspellLoadDictionaryTask::run(): time:" << perf.elapsed() << "ms"; #endif + } else { + VIRTUALKEYBOARD_DEBUG() << "Hunspell dictionary is missing for" << locale << ". Search paths" << searchPaths; } emit completed(*hunspellPtr != 0); |