From a585375406def7ab15d580928ede1eec30b382a4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 28 May 2009 19:19:34 +0200 Subject: use textedit's signal instead of the textedit's document's --- tools/linguist/linguist/messageeditorwidgets.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/linguist/linguist/messageeditorwidgets.cpp b/tools/linguist/linguist/messageeditorwidgets.cpp index 5270c0d..d23d42e 100644 --- a/tools/linguist/linguist/messageeditorwidgets.cpp +++ b/tools/linguist/linguist/messageeditorwidgets.cpp @@ -145,16 +145,15 @@ void FormatTextEdit::setEditable(bool editable) void FormatTextEdit::setPlainText(const QString &text, bool userAction) { - bool oldBlockState = false; if (!userAction) { // Prevent contentsChanged signal - oldBlockState = document()->blockSignals(true); + bool oldBlockState = blockSignals(true); document()->setUndoRedoEnabled(false); ExpandingTextEdit::setPlainText(text); // highlighter is out of sync because of blocked signals m_highlighter->rehighlight(); document()->setUndoRedoEnabled(true); - document()->blockSignals(oldBlockState); + blockSignals(oldBlockState); } else { ExpandingTextEdit::setPlainText(text); } @@ -178,7 +177,7 @@ FormWidget::FormWidget(const QString &label, bool isEditable, QWidget *parent) setLayout(layout); - connect(m_editor->document(), SIGNAL(contentsChanged()), SLOT(slotTextChanged())); + connect(m_editor, SIGNAL(textChanged()), SLOT(slotTextChanged())); connect(m_editor, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged())); connect(m_editor, SIGNAL(cursorPositionChanged()), SIGNAL(cursorPositionChanged())); } -- cgit v0.12