When a document gets reloaded for whatever reason, automatic spellcheck
should be refreshed so as to re-process the document contents.
BUG: 408291
FIXED-IN: 5.61.0
cullmann | |
dhaumann |
KTextEditor |
When a document gets reloaded for whatever reason, automatic spellcheck
should be refreshed so as to re-process the document contents.
BUG: 408291
FIXED-IN: 5.61.0
No Linters Available |
No Unit Test Coverage |
Buildable 13213 | |
Build 13231: arc lint + arc unit |
src/spellcheck/ontheflycheck.cpp | ||
---|---|---|
75 ↗ | (On Diff #60154) | That wouldn't work, reloaded() takes a Document pointer parameter whereas refreshSpellcheck takes a Range parameter. |
src/spellcheck/ontheflycheck.cpp | ||
---|---|---|
75 ↗ | (On Diff #60154) | But refreshSpellCheck() has a default parameter, so this function exists without any parameter. Afaik this should work?! |
src/spellcheck/ontheflycheck.cpp | ||
---|---|---|
75 ↗ | (On Diff #60154) | In file included from /usr/include/qt5/QtCore/qalgorithms.h:43, from /usr/include/qt5/QtCore/qlist.h:43, from /usr/include/qt5/QtCore/QList:1, from /home/ahmad/dev/ktexteditor/git/src/spellcheck/ontheflycheck.h:25, from /home/ahmad/dev/ktexteditor/git/src/spellcheck/ontheflycheck.cpp:26: /usr/include/qt5/QtCore/qobject.h: In instantiation of ‘static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType) [with Func1 = void (KTextEditor::Document::*)(KTextEditor::Document*); Func2 = void (KateOnTheFlyChecker::*)(const KTextEditor::Range&); typename QtPrivate::FunctionPointer<Func>::Object = KTextEditor::Document; typename QtPrivate::FunctionPointer<Func2>::Object = KateOnTheFlyChecker]’: /home/ahmad/dev/ktexteditor/git/src/spellcheck/ontheflycheck.cpp:76:58: required from here /usr/include/qt5/QtCore/qobject.h:241:9: error: static assertion failed: Signal and slot arguments are not compatible. 241 | Q_STATIC_ASSERT_X((QtPrivate::CheckCompatibleArguments<typename SignalType::Arguments, typename SlotType::Arguments>::value), | ^~~~~~~~~~~~~~~~~ |
Qt docs say that the signal must have at least as many arguments as the slot, and there is an implicit conversion between the types of the corresponding arguments in the signal and the slot.
src/spellcheck/ontheflycheck.cpp | ||
---|---|---|
75 ↗ | (On Diff #60154) | In that case, please use an anonymous lambda: [this](KTextEditor:: Document*){refreshSpellCheck ();} That keeps the code closer together. |