From 0cfa9cb2f343df424a240217da0bf22fdb53d973 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 6 Apr 2024 22:27:55 +0300 Subject: [PATCH] kdeui: remove unused private KTextEdit methods and members also initialized all members while at it, some could be used uninitialized Signed-off-by: Ivailo Monev --- kdeui/widgets/ktextedit.cpp | 29 +++++++---------------------- kdeui/widgets/ktextedit.h | 1 - 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/kdeui/widgets/ktextedit.cpp b/kdeui/widgets/ktextedit.cpp index 0ae50ead..3b95595a 100644 --- a/kdeui/widgets/ktextedit.cpp +++ b/kdeui/widgets/ktextedit.cpp @@ -28,12 +28,10 @@ #include #include #include -#include #include #include #include -#include #include #include #include @@ -61,7 +59,10 @@ class KTextEdit::Private { public: Private(KTextEdit *_parent) - : parent(_parent), + : parent(_parent), + autoSpellCheckAction(nullptr), + allowTab(nullptr), + italicizePlaceholder(true), customPalette(false), checkSpellingEnabled(false), findReplaceEnabled(true), @@ -75,7 +76,7 @@ class KTextEdit::Private repIndex(0), lastReplacedPosition(-1) { - //Check the default settings to see if spellchecking should be enabled. + // Check the default settings to see if spellchecking should be enabled. KConfigGroup spellgroup(KGlobal::config(), "Spelling"); checkSpellingEnabled = spellgroup.readEntry("checkerEnabledByDefault", false); @@ -113,12 +114,6 @@ class KTextEdit::Private void slotFindHighlight(const QString &text, int matchingIndex, int matchingLength); void slotReplaceText(const QString &text, int replacementIndex, int /*replacedLength*/, int matchedLength); - /** - * Similar to QTextEdit::clear(), only that it is possible to undo this - * action. - */ - void undoableClear(); - void slotAllowTab(); void menuActivated(QAction *action); @@ -136,14 +131,14 @@ class KTextEdit::Private bool checkSpellingEnabled; bool findReplaceEnabled; bool showTabAction; - QTextDocumentFragment originalDoc; QString spellCheckingLanguage; KSpellHighlighter *highlighter; KFindDialog *findDlg; KFind *find; KReplaceDialog *repDlg; KReplace *replace; - int findIndex, repIndex; + int findIndex; + int repIndex; int lastReplacedPosition; }; @@ -152,16 +147,6 @@ void KTextEdit::Private::toggleAutoSpellCheck() parent->setCheckSpellingEnabled(!parent->checkSpellingEnabled()); } -void KTextEdit::Private::undoableClear() -{ - QTextCursor cursor = parent->textCursor(); - cursor.beginEditBlock(); - cursor.movePosition(QTextCursor::Start); - cursor.movePosition(QTextCursor::End, QTextCursor::KeepAnchor); - cursor.removeSelectedText(); - cursor.endEditBlock(); -} - void KTextEdit::Private::slotAllowTab() { parent->setTabChangesFocus(!parent->tabChangesFocus()); diff --git a/kdeui/widgets/ktextedit.h b/kdeui/widgets/ktextedit.h index 48b01e8d..fcfc83a7 100644 --- a/kdeui/widgets/ktextedit.h +++ b/kdeui/widgets/ktextedit.h @@ -289,7 +289,6 @@ private: class Private; Private *const d; - Q_PRIVATE_SLOT( d, void undoableClear() ) Q_PRIVATE_SLOT( d, void toggleAutoSpellCheck() ) Q_PRIVATE_SLOT( d, void slotAllowTab() ) Q_PRIVATE_SLOT( d, void menuActivated(QAction *))