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:
@@ -54,12 +54,10 @@ public:
|
||||
BaseVcsEditorFactoryPrivate(const VcsBaseEditorParameters *t);
|
||||
|
||||
const VcsBaseEditorParameters *m_type;
|
||||
TextEditor::TextEditorActionHandler *m_editorHandler;
|
||||
};
|
||||
|
||||
BaseVcsEditorFactoryPrivate::BaseVcsEditorFactoryPrivate(const VcsBaseEditorParameters *t) :
|
||||
m_type(t),
|
||||
m_editorHandler(new TextEditor::TextEditorActionHandler(t->context))
|
||||
m_type(t)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -71,6 +69,7 @@ BaseVcsEditorFactory::BaseVcsEditorFactory(const VcsBaseEditorParameters *t)
|
||||
setId(t->id);
|
||||
setDisplayName(QCoreApplication::translate("VCS", t->displayName));
|
||||
addMimeType(t->mimeType);
|
||||
new TextEditor::TextEditorActionHandler(this, t->context);
|
||||
}
|
||||
|
||||
BaseVcsEditorFactory::~BaseVcsEditorFactory()
|
||||
|
||||
Reference in New Issue
Block a user