Commit 62acde46 authored by hjk's avatar hjk

QmlJSEditor: Partially move construction to new setup scheme

Change-Id: I61a6c4a51124b624d77a3b484c1f20ef5105f62a
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 307129bf
......@@ -175,8 +175,11 @@ QModelIndex QmlJSTextEditorWidget::outlineModelIndex()
IEditor *QmlJSEditor::duplicate()
{
QmlJSTextEditorWidget *newEditor = new QmlJSTextEditorWidget(editorWidget()->textDocumentPtr());
return newEditor->editor();
auto editor = new QmlJSEditor;
auto widget = new QmlJSTextEditorWidget(editorWidget()->textDocumentPtr());
editor->setEditorWidget(widget);
editor->configureCodeAssistant();
return editor;
}
bool QmlJSEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
......@@ -535,7 +538,7 @@ bool QmlJSTextEditorWidget::isClosingBrace(const QList<Token> &tokens) const
BaseTextEditor *QmlJSTextEditorWidget::createEditor()
{
return new QmlJSEditor;
QTC_ASSERT("should not happen anymore" && false, return 0);
}
void QmlJSTextEditorWidget::createToolBar()
......@@ -928,8 +931,10 @@ QmlJSEditorFactory::QmlJSEditorFactory()
IEditor *QmlJSEditorFactory::createEditor()
{
QmlJSTextEditorWidget *rc = new QmlJSTextEditorWidget(BaseTextDocumentPtr(new QmlJSEditorDocument));
return rc->editor();
auto editor = new QmlJSEditor;
editor->setEditorWidget(new QmlJSTextEditorWidget(BaseTextDocumentPtr(new QmlJSEditorDocument)));
editor->configureCodeAssistant();
return editor;
}
} // namespace Internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment