Changeset View
Changeset View
Standalone View
Standalone View
src/spellcheck/ontheflycheck.cpp
Show First 20 Lines • Show All 395 Lines • ▼ Show 20 Line(s) | 365 | { | |||
---|---|---|---|---|---|
396 | } | 396 | } | ||
397 | if (!m_backgroundChecker) { | 397 | if (!m_backgroundChecker) { | ||
398 | m_backgroundChecker = new Sonnet::BackgroundChecker(m_speller, this); | 398 | m_backgroundChecker = new Sonnet::BackgroundChecker(m_speller, this); | ||
399 | connect(m_backgroundChecker, | 399 | connect(m_backgroundChecker, | ||
400 | SIGNAL(misspelling(QString,int)), | 400 | SIGNAL(misspelling(QString,int)), | ||
401 | this, | 401 | this, | ||
402 | SLOT(misspelling(QString,int))); | 402 | SLOT(misspelling(QString,int))); | ||
403 | connect(m_backgroundChecker, SIGNAL(done()), this, SLOT(spellCheckDone())); | 403 | connect(m_backgroundChecker, SIGNAL(done()), this, SLOT(spellCheckDone())); | ||
404 | | ||||
405 | KateSpellCheckManager *m_spellCheckManager = KTextEditor::EditorPrivate::self()->spellCheckManager(); | ||||
406 | connect(m_spellCheckManager, &KateSpellCheckManager::wordAddedToDictionary, | ||||
407 | this, &KateOnTheFlyChecker::addToDictionary); | ||||
408 | connect(m_spellCheckManager, &KateSpellCheckManager::wordIgnored, | ||||
409 | this, &KateOnTheFlyChecker::addToSession); | ||||
404 | } | 410 | } | ||
405 | m_backgroundChecker->setSpeller(m_speller); | 411 | m_backgroundChecker->setSpeller(m_speller); | ||
406 | m_backgroundChecker->setText(text); // don't call 'start()' after this! | 412 | m_backgroundChecker->setText(text); // don't call 'start()' after this! | ||
407 | } | 413 | } | ||
408 | 414 | | |||
415 | void KateOnTheFlyChecker::addToDictionary(const QString &word) | ||||
416 | { | ||||
417 | if (m_backgroundChecker) { | ||||
418 | m_backgroundChecker->addWordToPersonal(word); | ||||
419 | } | ||||
420 | } | ||||
421 | | ||||
422 | void KateOnTheFlyChecker::addToSession(const QString &word) | ||||
423 | { | ||||
424 | if (m_backgroundChecker) { | ||||
425 | m_backgroundChecker->addWordToSession(word); | ||||
426 | } | ||||
427 | } | ||||
428 | | ||||
429 | | ||||
409 | void KateOnTheFlyChecker::removeRangeFromEverything(KTextEditor::MovingRange *movingRange) | 430 | void KateOnTheFlyChecker::removeRangeFromEverything(KTextEditor::MovingRange *movingRange) | ||
410 | { | 431 | { | ||
411 | Q_ASSERT(m_document == movingRange->document()); | 432 | Q_ASSERT(m_document == movingRange->document()); | ||
412 | ON_THE_FLY_DEBUG << *movingRange << "(" << movingRange << ")"; | 433 | ON_THE_FLY_DEBUG << *movingRange << "(" << movingRange << ")"; | ||
413 | 434 | | |||
414 | if (removeRangeFromModificationList(movingRange)) { | 435 | if (removeRangeFromModificationList(movingRange)) { | ||
415 | return; // range was part of the modification queue, so we don't have | 436 | return; // range was part of the modification queue, so we don't have | ||
416 | // to look further for it | 437 | // to look further for it | ||
▲ Show 20 Lines • Show All 492 Lines • Show Last 20 Lines |