aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/snippets
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-08-28 18:46:39 +0200
committerhjk <hjk121@nokiamail.com>2014-08-29 15:51:09 +0200
commitec5ea375e0cdd7ca83a55145abd3c47cbb570ef2 (patch)
treef3c9891a2e7318f8dbd3948f9673d0ff08dfd8eb /src/plugins/texteditor/snippets
parent92cab936b9f9dba3e6464b4ac676c66a8f61534c (diff)
TextEditor: Use more direct approach for fallback IEditor construction
There are still a few places where the EditorWidget is the primary object, or several of them per "visible" IEditor (e.g. Diff). Provide a means to streamline setup there, too. Change-Id: I14cfbd68e555ebc539e707032a0e5bef563e0a36 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/texteditor/snippets')
-rw-r--r--src/plugins/texteditor/snippets/snippeteditor.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/plugins/texteditor/snippets/snippeteditor.cpp b/src/plugins/texteditor/snippets/snippeteditor.cpp
index eae0b91be11..bfe9b9c93cf 100644
--- a/src/plugins/texteditor/snippets/snippeteditor.cpp
+++ b/src/plugins/texteditor/snippets/snippeteditor.cpp
@@ -49,15 +49,7 @@ namespace TextEditor {
SnippetEditorWidget::SnippetEditorWidget(QWidget *parent)
: BaseTextEditorWidget(parent)
{
- setSimpleTextDocument(TextEditor::Constants::SNIPPET_EDITOR_ID);
- textDocument()->setFontSettings(TextEditorSettings::fontSettings());
-
- // Should not be necessary in this case, but the base text editor
- // implementation assumes a valid associated editor.
- auto dummy = new BaseTextEditor;
- dummy->addContext(Constants::SNIPPET_EDITOR_ID);
- dummy->setEditorWidget(this);
-
+ setupFallBackEditor(TextEditor::Constants::SNIPPET_EDITOR_ID);
setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
setHighlightCurrentLine(false);
setLineNumbersVisible(false);