Index: src/plugins/hunspell/hunspelldict.cpp =================================================================== --- src/plugins/hunspell/hunspelldict.cpp +++ src/plugins/hunspell/hunspelldict.cpp @@ -102,23 +102,20 @@ if (!m_speller) { return false; } - int result = m_speller->spell(toDictEncoding(word).constData()); + bool result = m_speller->spell(toDictEncoding(word).toStdString()); qCDebug(SONNET_HUNSPELL) << " result :" << result; - return result != 0; + return result; } QStringList HunspellDict::suggest(const QString &word) const { if (!m_speller) { return QStringList(); } - char **selection; QStringList lst; - int nbWord = m_speller->suggest(&selection, toDictEncoding(word).constData()); - for (int i = 0; i < nbWord; ++i) { - lst << m_codec->toUnicode(selection[i]); - } - m_speller->free_list(&selection, nbWord); + const auto suggestions = m_speller->suggest(toDictEncoding(word).toStdString()); + for_each (suggestions.begin(), suggestions.end(), [this, &lst](const std::string &suggestion) { + lst << m_codec->toUnicode(suggestion.c_str()); }); return lst; }