summaryrefslogtreecommitdiff
path: root/src/plugins/texteditor/plaintexteditor.cpp
diff options
context:
space:
mode:
authorLeandro Melo <leandro.melo@nokia.com>2010-10-13 16:26:29 +0200
committerLeandro Melo <leandro.melo@nokia.com>2010-10-13 16:37:05 +0200
commit44cefd73b19055e8b15041482e6f39cd24ce4db0 (patch)
tree8c6d188ff10b5d9d023757e665d44be5bc4cb7c0 /src/plugins/texteditor/plaintexteditor.cpp
parent47310350a1395d7e80ce207e43629a7ae78bc9da (diff)
downloadqt-creator-44cefd73b19055e8b15041482e6f39cd24ce4db0.tar.gz
Text editor: Fix potential crash in the plain text editor.
Example situation: The plain text editor is displaying in-memory content and has not been explicitly "configured". If there's an attempt to indent the text it crashes since the indenter is invalid. This can happen if one clicks on 'Show View Contents in Editor' within a debug session and press enter in the editor. Reviewed-by: con
Diffstat (limited to 'src/plugins/texteditor/plaintexteditor.cpp')
-rw-r--r--src/plugins/texteditor/plaintexteditor.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/plugins/texteditor/plaintexteditor.cpp b/src/plugins/texteditor/plaintexteditor.cpp
index 74060a2e2e..ea1a0b0a2c 100644
--- a/src/plugins/texteditor/plaintexteditor.cpp
+++ b/src/plugins/texteditor/plaintexteditor.cpp
@@ -63,7 +63,8 @@ PlainTextEditorEditable::PlainTextEditorEditable(PlainTextEditor *editor)
PlainTextEditor::PlainTextEditor(QWidget *parent)
: BaseTextEditor(parent),
m_isMissingSyntaxDefinition(false),
- m_ignoreMissingSyntaxDefinition(false)
+ m_ignoreMissingSyntaxDefinition(false),
+ m_indenter(new NormalIndenter) // Currently only "normal" indentation is supported.
{
setRevisionsVisible(true);
setMarksVisible(true);
@@ -199,11 +200,6 @@ void PlainTextEditor::configure(const Core::MimeType &mimeType)
setFontSettings(TextEditorSettings::instance()->fontSettings());
- // @todo: Indentation specification through the definition files is not really being used
- // because Kate recommends to configure indentation through another feature. Maybe we should
- // provide something similar in Creator? For now, only normal indentation is supported.
- m_indenter.reset(new NormalIndenter);
-
emit configured(editableInterface());
}