Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed with hunspell 1.5.4 #399

Open
Hubbitus opened this issue Jan 6, 2017 · 1 comment
Open

Build failed with hunspell 1.5.4 #399

Hubbitus opened this issue Jan 6, 2017 · 1 comment
Labels

Comments

@Hubbitus
Copy link

Hubbitus commented Jan 6, 2017

/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

@nico-izo nico-izo added the medium label Jan 6, 2017
@sibskull
Copy link

sibskull commented Dec 5, 2018

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants