forked from qt-creator/qt-creator
Remove the need to register editors in the action handler
The action handler already knows which editors to handle through the context. It only needs to receive signals for updating the actions from the current editor. So there is no need to tell the action handler about every individual editor. This also removes some noise from the text editor implementations. Change-Id: I76dc5b1559cc8cf54ff313e6cdba4e789a3108aa Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
@@ -43,7 +43,6 @@
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <texteditor/texteditorconstants.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QCoreApplication>
|
||||
@@ -223,12 +222,11 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error
|
||||
addObject(m_factory);
|
||||
|
||||
// Initialize editor actions handler
|
||||
m_actionHandler.reset(new TextEditor::TextEditorActionHandler(
|
||||
m_actionHandler = new TextEditor::TextEditorActionHandler(
|
||||
C_PYTHONEDITOR_ID,
|
||||
TextEditor::TextEditorActionHandler::Format
|
||||
| TextEditor::TextEditorActionHandler::UnCommentSelection
|
||||
| TextEditor::TextEditorActionHandler::UnCollapseAll));
|
||||
m_actionHandler->initializeActions();
|
||||
| TextEditor::TextEditorActionHandler::UnCollapseAll);
|
||||
|
||||
// Add MIME overlay icons (these icons displayed at Project dock panel)
|
||||
const QIcon icon = QIcon::fromTheme(QLatin1String(C_PY_MIME_ICON));
|
||||
@@ -247,12 +245,6 @@ void PythonEditorPlugin::extensionsInitialized()
|
||||
{
|
||||
}
|
||||
|
||||
void PythonEditorPlugin::initializeEditor(EditorWidget *widget)
|
||||
{
|
||||
instance()->m_actionHandler->setupActions(widget);
|
||||
TextEditor::TextEditorSettings::initializeEditor(widget);
|
||||
}
|
||||
|
||||
QSet<QString> PythonEditorPlugin::keywords()
|
||||
{
|
||||
return instance()->m_keywords;
|
||||
|
||||
Reference in New Issue
Block a user