kdeplasma-addons: adjust spellcheck applet to KTextEdit changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-04-09 06:19:32 +03:00
parent faa0514619
commit ae1492b768

View file

@ -197,7 +197,6 @@ void SpellCheck::toggleDialog(bool pasteText, bool preferSelection)
m_textEdit = new KTextEdit(m_spellingDialog);
m_textEdit->enableFindReplace(false);
m_textEdit->setCheckSpellingEnabled(true);
m_textEdit->createHighlighter();
m_dictionaryComboBox = new KSpellDictionaryComboBox(m_spellingDialog);
m_dictionaryComboBox->setToolTip(i18n("Language"));
@ -227,7 +226,6 @@ void SpellCheck::toggleDialog(bool pasteText, bool preferSelection)
connect(m_spellingDialog, SIGNAL(dialogResized()), this, SLOT(dialogResized()));
connect(copyAction, SIGNAL(triggered()), this, SLOT(copyToClipboard()));
connect(closeAction, SIGNAL(triggered()), this, SLOT(toggleDialog()));
connect(m_textEdit, SIGNAL(languageChanged(QString)), this, SLOT(setLanguage(QString)));
connect(m_dictionaryComboBox, SIGNAL(dictionaryChanged(QString)), this, SLOT(setLanguage(QString)));
}
@ -273,8 +271,8 @@ void SpellCheck::copyToClipboard()
void SpellCheck::setLanguage(const QString &language)
{
if (language != m_textEdit->spellCheckingLanguage()) {
m_textEdit->setSpellCheckingLanguage(language);
if (language != m_textEdit->highlighter()->currentLanguage()) {
m_textEdit->highlighter()->setCurrentLanguage(language);
}
m_dictionaryComboBox->setCurrentByDictionary(language);