diff --git a/src/spellcheck/spellcheckbar.cpp b/src/spellcheck/spellcheckbar.cpp --- a/src/spellcheck/spellcheckbar.cpp +++ b/src/spellcheck/spellcheckbar.cpp @@ -293,18 +293,19 @@ void SpellCheckBar::fillDictionaryComboBox() { + // Since m_language is changed to DictionaryComboBox most code here is gone, + // So fillDictionaryComboBox() could be removed and code moved to initGui() + // because the call in show() looks obsolete Sonnet::Speller speller = d->checker->speller(); d->dictsMap = speller.availableDictionaries(); - QStringList langs = d->dictsMap.keys(); - d->ui.m_language->clear(); - d->ui.m_language->addItems(langs); + updateDictionaryComboBox(); } void SpellCheckBar::updateDictionaryComboBox() { Sonnet::Speller speller = d->checker->speller(); - d->ui.m_language->setCurrentIndex(d->dictsMap.values().indexOf(speller.language())); + d->ui.m_language->setCurrentByDictionary(speller.language()); } void SpellCheckBar::updateDialog(const QString &word) diff --git a/src/spellcheck/spellcheckbar.ui b/src/spellcheck/spellcheckbar.ui --- a/src/spellcheck/spellcheckbar.ui +++ b/src/spellcheck/spellcheckbar.ui @@ -164,7 +164,7 @@ - + Language Selection @@ -238,6 +238,11 @@ QComboBox
kcombobox.h
+ + Sonnet::DictionaryComboBox + QComboBox +
sonnet/dictionarycombobox.h
+
m_addBtn