forked from qt-creator/qt-creator
TextEditor: Centralize settings connections setup
All editors did that manually, with varying approaches. Connect once when the document is made known to the EditorWidget instead. Change-Id: Ib0828b08158539859f6f89c8080435a027aa06ed Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -47,7 +47,6 @@
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <texteditor/basetexteditor.h>
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
@@ -112,7 +111,6 @@ AndroidManifestEditorWidget::AndroidManifestEditorWidget()
|
||||
{
|
||||
m_textEditorWidget = new AndroidManifestTextEditorWidget(this);
|
||||
m_textEditorWidget->setupAsPlainEditor();
|
||||
TextEditor::TextEditorSettings::initializeEditor(m_textEditorWidget);
|
||||
|
||||
initializePage();
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "androidconstants.h"
|
||||
#include "javacompletionassistprovider.h"
|
||||
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/normalindenter.h>
|
||||
#include <texteditor/highlighterutils.h>
|
||||
@@ -56,14 +55,12 @@ JavaEditor::JavaEditor()
|
||||
setDuplicateSupported(true);
|
||||
setCommentStyle(Utils::CommentDefinition::CppStyle);
|
||||
setCompletionAssistProvider(ExtensionSystem::PluginManager::getObject<JavaCompletionAssistProvider>());
|
||||
setAutoCompleter(new JavaAutoCompleter);
|
||||
}
|
||||
|
||||
Core::IEditor *JavaEditor::duplicate()
|
||||
{
|
||||
JavaEditorWidget *ret = new JavaEditorWidget;
|
||||
ret->setTextDocument(editorWidget()->textDocumentPtr());
|
||||
TextEditor::TextEditorSettings::initializeEditor(ret);
|
||||
return ret->editor();
|
||||
}
|
||||
|
||||
@@ -73,6 +70,7 @@ Core::IEditor *JavaEditor::duplicate()
|
||||
|
||||
JavaEditorWidget::JavaEditorWidget()
|
||||
{
|
||||
setAutoCompleter(new JavaAutoCompleter);
|
||||
}
|
||||
|
||||
TextEditor::BaseTextEditor *JavaEditorWidget::createEditor()
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "androidconstants.h"
|
||||
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
|
||||
using namespace Android;
|
||||
using namespace Android::Internal;
|
||||
@@ -50,6 +49,5 @@ Core::IEditor *JavaEditorFactory::createEditor()
|
||||
{
|
||||
JavaEditorWidget *editor = new JavaEditorWidget;
|
||||
editor->setTextDocument(TextEditor::BaseTextDocumentPtr(new JavaDocument));
|
||||
TextEditor::TextEditorSettings::initializeEditor(editor);
|
||||
return editor->editor();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user