diff --git a/kdeplasma-addons/runners/spellchecker/spellcheck.cpp b/kdeplasma-addons/runners/spellchecker/spellcheck.cpp index b1218082..f1d27b0a 100644 --- a/kdeplasma-addons/runners/spellchecker/spellcheck.cpp +++ b/kdeplasma-addons/runners/spellchecker/spellcheck.cpp @@ -75,9 +75,6 @@ void SpellCheckRunner::match(Plasma::RunnerContext &context) terms.removeFirst(); } - Plasma::QueryMatch match(this); - match.setType(Plasma::QueryMatch::InformationalMatch); - QString spellerdictionary; if (terms.size() > 1 && m_speller->dictionaries().contains(terms.at(0))) { spellerdictionary = terms.at(0); @@ -86,6 +83,8 @@ void SpellCheckRunner::match(Plasma::RunnerContext &context) spellerdictionary = KSpeller::defaultLanguage(); } if (!m_speller->setDictionary(spellerdictionary)) { + Plasma::QueryMatch match(this); + match.setType(Plasma::QueryMatch::InformationalMatch); match.setIcon(KIcon(QLatin1String("task-attention"))); match.setText(i18n("Could not find a dictionary.")); context.addMatch(term, match); @@ -94,6 +93,8 @@ void SpellCheckRunner::match(Plasma::RunnerContext &context) foreach (const QString &word, terms) { + Plasma::QueryMatch match(this); + match.setType(Plasma::QueryMatch::InformationalMatch); const bool correct = m_speller->check(word); if (correct) { match.setIcon(KIcon(QLatin1String("checkbox"))); @@ -109,9 +110,8 @@ void SpellCheckRunner::match(Plasma::RunnerContext &context) match.setData(suggestions); } } + context.addMatch(term, match); } - - context.addMatch(term, match); } void SpellCheckRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match)