Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/ktextedit.cpp
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 76 | #ifdef HAVE_SPEECH | |||
---|---|---|---|---|---|
77 | textToSpeech(nullptr), | 77 | textToSpeech(nullptr), | ||
78 | #endif | 78 | #endif | ||
79 | findIndex(0), repIndex(0), | 79 | findIndex(0), repIndex(0), | ||
80 | lastReplacedPosition(-1) | 80 | lastReplacedPosition(-1) | ||
81 | { | 81 | { | ||
82 | //Check the default sonnet settings to see if spellchecking should be enabled. | 82 | //Check the default sonnet settings to see if spellchecking should be enabled. | ||
83 | QSettings settings(QStringLiteral("KDE"), QStringLiteral("Sonnet")); | 83 | QSettings settings(QStringLiteral("KDE"), QStringLiteral("Sonnet")); | ||
84 | spellCheckingEnabled = settings.value(QStringLiteral("checkerEnabledByDefault"), false).toBool(); | 84 | spellCheckingEnabled = settings.value(QStringLiteral("checkerEnabledByDefault"), false).toBool(); | ||
85 | #ifdef HAVE_SPEECH | | |||
86 | textToSpeech = new QTextToSpeech(parent); | | |||
87 | #endif | | |||
88 | } | 85 | } | ||
89 | 86 | | |||
90 | ~Private() | 87 | ~Private() | ||
91 | { | 88 | { | ||
92 | delete decorator; | 89 | delete decorator; | ||
93 | delete findDlg; | 90 | delete findDlg; | ||
94 | delete find; | 91 | delete find; | ||
95 | delete replace; | 92 | delete replace; | ||
▲ Show 20 Lines • Show All 546 Lines • ▼ Show 20 Line(s) | |||||
642 | { | 639 | { | ||
643 | #ifdef HAVE_SPEECH | 640 | #ifdef HAVE_SPEECH | ||
644 | QString text; | 641 | QString text; | ||
645 | if (textCursor().hasSelection()) { | 642 | if (textCursor().hasSelection()) { | ||
646 | text = textCursor().selectedText(); | 643 | text = textCursor().selectedText(); | ||
647 | } else { | 644 | } else { | ||
648 | text = toPlainText(); | 645 | text = toPlainText(); | ||
649 | } | 646 | } | ||
647 | if (!d->textToSpeech) { | ||||
648 | d->textToSpeech = new QTextToSpeech(this); | ||||
649 | } | ||||
650 | d->textToSpeech->say(text); | 650 | d->textToSpeech->say(text); | ||
651 | #endif | 651 | #endif | ||
652 | } | 652 | } | ||
653 | 653 | | |||
654 | void KTextEdit::contextMenuEvent(QContextMenuEvent *event) | 654 | void KTextEdit::contextMenuEvent(QContextMenuEvent *event) | ||
655 | { | 655 | { | ||
656 | QMenu *popup = mousePopupMenu(); | 656 | QMenu *popup = mousePopupMenu(); | ||
657 | if (popup) { | 657 | if (popup) { | ||
▲ Show 20 Lines • Show All 410 Lines • Show Last 20 Lines |