forked from qt-creator/qt-creator
TextEditor: Remove indenter construction from PlainTextEditorWidget
Do it in the users "that know" and remove the special constructor case. Change-Id: I9298c8d13118068adc7958c0894dccb7af4d7855 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "plaintexteditorfactory.h"
|
||||
#include "plaintexteditor.h"
|
||||
#include "basetextdocument.h"
|
||||
#include "normalindenter.h"
|
||||
#include "texteditoractionhandler.h"
|
||||
#include "texteditorconstants.h"
|
||||
#include "texteditorplugin.h"
|
||||
@@ -60,12 +61,14 @@ PlainTextEditorFactory::PlainTextEditorFactory(QObject *parent)
|
||||
|
||||
Core::IEditor *PlainTextEditorFactory::createEditor()
|
||||
{
|
||||
PlainTextEditorWidget *rc = new PlainTextEditorWidget();
|
||||
TextEditorSettings::initializeEditor(rc);
|
||||
connect(rc, SIGNAL(configured(Core::IEditor*)),
|
||||
auto doc = new PlainTextDocument;
|
||||
doc->setIndenter(new NormalIndenter);
|
||||
auto widget = new PlainTextEditorWidget(doc);
|
||||
TextEditorSettings::initializeEditor(widget);
|
||||
connect(widget, SIGNAL(configured(Core::IEditor*)),
|
||||
this, SLOT(updateEditorInfoBar(Core::IEditor*)));
|
||||
updateEditorInfoBar(rc->editor());
|
||||
return rc->editor();
|
||||
updateEditorInfoBar(widget->editor());
|
||||
return widget->editor();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user