Commit bce0560c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt to new api

parent 14f1bfb5
......@@ -33,6 +33,7 @@
#include <sonnet/backgroundchecker.h>
#include <Sonnet/Dialog>
#include "texttospeech/texttospeech.h"
#include <sonnet_version.h>
#include <QMenu>
#include <QDBusConnection>
......@@ -361,9 +362,12 @@ void PlainTextEditor::slotCheckSpelling()
connect(spellDialog, &Sonnet::Dialog::replace, this, &PlainTextEditor::slotSpellCheckerCorrected);
connect(spellDialog, &Sonnet::Dialog::misspelling, this, &PlainTextEditor::slotSpellCheckerMisspelling);
connect(spellDialog, &Sonnet::Dialog::autoCorrect, this, &PlainTextEditor::slotSpellCheckerAutoCorrect);
#if SONNET_VERSION < QT_VERSION_CHECK(5, 65, 0)
connect(spellDialog, QOverload<const QString &>::of(&Sonnet::Dialog::done),
this, &PlainTextEditor::slotSpellCheckerFinished);
#else
connect(spellDialog, &Sonnet::Dialog::spellCheckDone, this, &PlainTextEditor::slotSpellCheckerFinished);
#endif
connect(spellDialog, &Sonnet::Dialog::cancel, this, &PlainTextEditor::slotSpellCheckerCanceled);
connect(spellDialog, &Sonnet::Dialog::spellCheckStatus, this, &PlainTextEditor::spellCheckStatus);
connect(spellDialog, &Sonnet::Dialog::languageChanged, this, &PlainTextEditor::languageChanged);
......
......@@ -38,6 +38,7 @@
#include <sonnet/speller.h>
#include <texttospeech/texttospeech.h>
#include <SonnetCore/sonnet/backgroundchecker.h>
#include <sonnet_version.h>
#include <KIO/KUriFilterSearchProviderActions>
#include <QMenu>
......@@ -461,15 +462,23 @@ void RichTextEditor::checkSpelling(bool force)
connect(spellDialog, &Sonnet::Dialog::replace, this, &RichTextEditor::slotSpellCheckerCorrected);
connect(spellDialog, &Sonnet::Dialog::misspelling, this, &RichTextEditor::slotSpellCheckerMisspelling);
connect(spellDialog, &Sonnet::Dialog::autoCorrect, this, &RichTextEditor::slotSpellCheckerAutoCorrect);
#if SONNET_VERSION < QT_VERSION_CHECK(5, 65, 0)
connect(spellDialog, QOverload<const QString &>::of(&Sonnet::Dialog::done),
this, &RichTextEditor::slotSpellCheckerFinished);
#else
connect(spellDialog, &Sonnet::Dialog::spellCheckDone, this, &RichTextEditor::slotSpellCheckerFinished);
#endif
connect(spellDialog, &Sonnet::Dialog::cancel, this, &RichTextEditor::slotSpellCheckerCanceled);
connect(spellDialog, &Sonnet::Dialog::spellCheckStatus, this, &RichTextEditor::spellCheckStatus);
connect(spellDialog, &Sonnet::Dialog::languageChanged, this, &RichTextEditor::languageChanged);
if (force) {
#if SONNET_VERSION < QT_VERSION_CHECK(5, 65, 0)
connect(spellDialog, SIGNAL(done(QString)), this, SIGNAL(spellCheckingFinished()));
//connect(spellDialog, &Sonnet::Dialog::done, this, &RichTextEditor::spellCheckingFinished);
#else
connect(spellDialog, &Sonnet::Dialog::spellCheckDone, this, &RichTextEditor::spellCheckingFinished);
#endif
connect(spellDialog, &Sonnet::Dialog::cancel, this, &RichTextEditor::spellCheckingCanceled);
}
d->originalDoc = QTextDocumentFragment(document());
spellDialog->setBuffer(toPlainText());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment