From d80fb696aba1594afa76d0573d79e9aa9da09005 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 10 Dec 2013 17:13:21 +0100 Subject: Give TextEditorActionHandler an explicit parent and unify usage. The action handler implicitly passed ownership to ICore, which is non- to the action handler. We now consistently create the action handler in the editor factory, give ownership to the editor factory, and don't hold a reference to it. Change-Id: I4372f8de966e3ceff87c06c5528c6b54522c1d57 Reviewed-by: David Schulz --- src/plugins/pythoneditor/pythoneditorfactory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/pythoneditor/pythoneditorfactory.cpp') 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 #include +#include #include #include @@ -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) -- cgit v1.2.1