qutim icon indicating copy to clipboard operation
qutim copied to clipboard

Build failed with hunspell 1.5.4

Open Hubbitus opened this issue 8 years ago • 1 comments

/builddir/build/BUILD/qutim.468bede/src/plugins/generic/hunspeller/src/hunspellchecker.cpp:89:30: error: no matching function for call to 'Hunspell::add(QByteArray)'
  m_speller->add(convert(word));

Full build log: https://kojipkgs.fedoraproject.org//work/tasks/3456/17183456/build.log

Hubbitus avatar Jan 06 '17 23:01 Hubbitus

Try this patch:

diff --git a/qutim/plugins/hunspeller/src/hunspellchecker.cpp b/qutim/plugins/hunspeller/src/hunspellchecker.cpp
index a7e99de..35b8f18 100644
--- a/qutim/plugins/hunspeller/src/hunspellchecker.cpp
+++ b/qutim/plugins/hunspeller/src/hunspellchecker.cpp
@@ -66,7 +66,8 @@ bool HunSpellChecker::isCorrect(const QString &word) const
 {
        if (!m_speller)
                return true; //unnecessary underline all words
-       return m_speller->spell(QString(convert(word)));
+       QByteArray b = convert(word);
+       return m_speller->spell(std::string(b.constData(), b.length()));
 }
 
 QStringList HunSpellChecker::suggest(const QString &word) const
@@ -75,7 +76,8 @@ QStringList HunSpellChecker::suggest(const QString &word) const
                return QStringList();
        char **selection;
        QStringList lst;
-       int count = m_speller->suggest(&selection, QString(convert(word)));
+       QByteArray b = convert(word);
+       int count = m_speller->suggest(&selection, std::string(b.constData(), b.length()).c_str());
        for(int i = 0; i < count; ++i)
                lst << (m_codec ? m_codec->toUnicode(selection[i]) : QString::fromUtf8(selection[i]));
        m_speller->free_list(&selection, count);
@@ -86,7 +88,8 @@ void HunSpellChecker::store(const QString &word) const
 {
        if (!m_speller)
                return;
-       m_speller->add(QString(convert(word)));
+       QByteArray b = convert(word);
+       m_speller->add(std::string(b.constData(), b.length()));
 }
 
 void HunSpellChecker::storeReplacement(const QString &bad, const QString &good)

sibskull avatar Dec 05 '18 11:12 sibskull