summaryrefslogtreecommitdiff
path: root/src/plugins/pythoneditor/pythoneditorfactory.cpp
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-07-31 14:44:42 +0200
committerhjk <hjk121@nokiamail.com>2014-08-01 14:10:23 +0200
commitf5b0bd32b20fc1e37f95b412252b597b9936dda7 (patch)
treecfc1caf4b8adb4a1b3cbc6380ef6d009039d6ade /src/plugins/pythoneditor/pythoneditorfactory.cpp
parent73d41589ab1aeb3be2593045618fc15e4592c17b (diff)
downloadqt-creator-f5b0bd32b20fc1e37f95b412252b597b9936dda7.tar.gz
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 <christian.stenger@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/pythoneditor/pythoneditorfactory.cpp')
-rw-r--r--src/plugins/pythoneditor/pythoneditorfactory.cpp8
1 files changed, 7 insertions, 1 deletions
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 <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
@@ -39,6 +40,8 @@
#include <QDebug>
+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();