diff options
Diffstat (limited to 'src/plugins/pythoneditor')
-rw-r--r-- | src/plugins/pythoneditor/pythoneditorfactory.cpp | 6 | ||||
-rw-r--r-- | src/plugins/pythoneditor/pythoneditorplugin.cpp | 7 | ||||
-rw-r--r-- | src/plugins/pythoneditor/pythoneditorplugin.h | 3 |
3 files changed, 6 insertions, 10 deletions
diff --git a/src/plugins/pythoneditor/pythoneditorfactory.cpp b/src/plugins/pythoneditor/pythoneditorfactory.cpp index e8b0d67274..4837e02419 100644 --- a/src/plugins/pythoneditor/pythoneditorfactory.cpp +++ b/src/plugins/pythoneditor/pythoneditorfactory.cpp @@ -34,6 +34,7 @@ #include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> +#include <texteditor/texteditoractionhandler.h> #include <texteditor/texteditorsettings.h> #include <QDebug> @@ -47,6 +48,11 @@ EditorFactory::EditorFactory(QObject *parent) setId(Constants::C_PYTHONEDITOR_ID); setDisplayName(tr(Constants::C_EDITOR_DISPLAY_NAME)); addMimeType(QLatin1String(Constants::C_PY_MIMETYPE)); + new TextEditor::TextEditorActionHandler(this, + Constants::C_PYTHONEDITOR_ID, + TextEditor::TextEditorActionHandler::Format + | TextEditor::TextEditorActionHandler::UnCommentSelection + | TextEditor::TextEditorActionHandler::UnCollapseAll); } Core::IEditor *EditorFactory::createEditor(QWidget *parent) diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index 873661e185..97b17d06ea 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -197,7 +197,6 @@ static void copyIdentifiers(const char * const words[], size_t bytesCount, QSet< PythonEditorPlugin::PythonEditorPlugin() : m_factory(0) - , m_actionHandler(0) { m_instance = this; copyIdentifiers(LIST_OF_PYTHON_KEYWORDS, sizeof(LIST_OF_PYTHON_KEYWORDS), m_keywords); @@ -222,12 +221,6 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error addObject(m_factory); // Initialize editor actions handler - m_actionHandler = new TextEditor::TextEditorActionHandler( - C_PYTHONEDITOR_ID, - TextEditor::TextEditorActionHandler::Format - | TextEditor::TextEditorActionHandler::UnCommentSelection - | TextEditor::TextEditorActionHandler::UnCollapseAll); - // Add MIME overlay icons (these icons displayed at Project dock panel) const QIcon icon = QIcon::fromTheme(QLatin1String(C_PY_MIME_ICON)); if (!icon.isNull()) diff --git a/src/plugins/pythoneditor/pythoneditorplugin.h b/src/plugins/pythoneditor/pythoneditorplugin.h index 529d30202c..895a94e2f5 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.h +++ b/src/plugins/pythoneditor/pythoneditorplugin.h @@ -31,9 +31,7 @@ #define PYTHONEDITOR_PLUGIN_H #include <extensionsystem/iplugin.h> -#include <texteditor/texteditoractionhandler.h> #include <QSet> -#include <QScopedPointer> namespace PythonEditor { namespace Internal { @@ -65,7 +63,6 @@ public: private: static PythonEditorPlugin *m_instance; EditorFactory *m_factory; - TextEditor::TextEditorActionHandler *m_actionHandler; QSet<QString> m_keywords; QSet<QString> m_magics; QSet<QString> m_builtins; |