From f5b0bd32b20fc1e37f95b412252b597b9936dda7 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 31 Jul 2014 14:44:42 +0200 Subject: TextEditor: Remove one stack of EditorWidget constructors There are conceptually only two: one that operates a new document, and one that shares one. Being explicit makes moving data over to the Editor hierarchy easier. Convenience can be re-added there, later. Change-Id: I9b34ff26628c99ffff01201dcf99332d5e7253e9 Reviewed-by: Christian Stenger Reviewed-by: hjk --- src/plugins/pythoneditor/pythoneditorfactory.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/plugins/pythoneditor/pythoneditorfactory.cpp') diff --git a/src/plugins/pythoneditor/pythoneditorfactory.cpp b/src/plugins/pythoneditor/pythoneditorfactory.cpp index 483309899c..8a3c19e232 100644 --- a/src/plugins/pythoneditor/pythoneditorfactory.cpp +++ b/src/plugins/pythoneditor/pythoneditorfactory.cpp @@ -31,6 +31,7 @@ #include "pythoneditorconstants.h" #include "pythoneditorwidget.h" #include "pythoneditorplugin.h" +#include "tools/pythonindenter.h" #include #include @@ -39,6 +40,8 @@ #include +using namespace TextEditor; + namespace PythonEditor { namespace Internal { @@ -57,7 +60,10 @@ EditorFactory::EditorFactory(QObject *parent) Core::IEditor *EditorFactory::createEditor() { - PythonEditorWidget *widget = new PythonEditorWidget(); + auto doc = new BaseTextDocument; + doc->setId(Constants::C_PYTHONEDITOR_ID); + doc->setIndenter(new PythonIndenter); + PythonEditorWidget *widget = new PythonEditorWidget(doc, 0); TextEditor::TextEditorSettings::initializeEditor(widget); return widget->editor(); -- cgit v1.2.1