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:
@@ -34,6 +34,7 @@
|
||||
#include "qmljseditorplugin.h"
|
||||
|
||||
#include <qmljstools/qmljstoolsconstants.h>
|
||||
#include <texteditor/texteditoractionhandler.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
@@ -52,6 +53,12 @@ QmlJSEditorFactory::QmlJSEditorFactory(QObject *parent)
|
||||
addMimeType(QmlJSTools::Constants::QMLTYPES_MIMETYPE);
|
||||
addMimeType(QmlJSTools::Constants::JS_MIMETYPE);
|
||||
addMimeType(QmlJSTools::Constants::JSON_MIMETYPE);
|
||||
new TextEditor::TextEditorActionHandler(this, Constants::C_QMLJSEDITOR_ID,
|
||||
TextEditor::TextEditorActionHandler::Format
|
||||
| TextEditor::TextEditorActionHandler::UnCommentSelection
|
||||
| TextEditor::TextEditorActionHandler::UnCollapseAll
|
||||
| TextEditor::TextEditorActionHandler::FollowSymbolUnderCursor);
|
||||
|
||||
}
|
||||
|
||||
Core::IEditor *QmlJSEditorFactory::createEditor(QWidget *parent)
|
||||
|
||||
Reference in New Issue
Block a user