diff options
author | Eike Ziller <eike.ziller@digia.com> | 2013-12-10 15:54:20 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2013-12-12 09:59:27 +0100 |
commit | 3d1b70c58e0d2eea47572ec4a018a18674508f9b (patch) | |
tree | 2217255fb7d6bc8e3e30603bb985cb655ab7be7d /src/plugins/pythoneditor/pythoneditorplugin.cpp | |
parent | 3ee9fb4d1c74058c785f24d19bac5fe879c75109 (diff) | |
download | qt-creator-3d1b70c58e0d2eea47572ec4a018a18674508f9b.tar.gz |
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>
Diffstat (limited to 'src/plugins/pythoneditor/pythoneditorplugin.cpp')
-rw-r--r-- | src/plugins/pythoneditor/pythoneditorplugin.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index 856c0677a7..873661e185 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -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; |