forked from qt-creator/qt-creator
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 <david.schulz@digia.com>
This commit is contained in:
@@ -51,18 +51,13 @@ PlainTextEditorFactory::PlainTextEditorFactory(QObject *parent)
|
||||
setDisplayName(qApp->translate("OpenWith::Editors", Core::Constants::K_DEFAULT_TEXT_EDITOR_DISPLAY_NAME));
|
||||
addMimeType(QLatin1String(TextEditor::Constants::C_TEXTEDITOR_MIMETYPE_TEXT));
|
||||
|
||||
m_actionHandler = new TextEditorActionHandler(
|
||||
new TextEditorActionHandler(this,
|
||||
TextEditor::Constants::C_TEXTEDITOR,
|
||||
TextEditorActionHandler::Format |
|
||||
TextEditorActionHandler::UnCommentSelection |
|
||||
TextEditorActionHandler::UnCollapseAll);
|
||||
}
|
||||
|
||||
PlainTextEditorFactory::~PlainTextEditorFactory()
|
||||
{
|
||||
delete m_actionHandler;
|
||||
}
|
||||
|
||||
Core::IEditor *PlainTextEditorFactory::createEditor(QWidget *parent)
|
||||
{
|
||||
PlainTextEditorWidget *rc = new PlainTextEditorWidget(parent);
|
||||
|
||||
Reference in New Issue
Block a user