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:
hjk
2014-07-30 10:41:06 +02:00
parent fde176e51c
commit 01822144d1
5 changed files with 13 additions and 16 deletions

View File

@@ -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();
}
/*!