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:
@@ -41,12 +41,12 @@ using namespace Android::Internal;
|
||||
|
||||
|
||||
AndroidManifestEditorFactory::AndroidManifestEditorFactory(QObject *parent)
|
||||
: Core::IEditorFactory(parent),
|
||||
m_actionHandler(new TextEditor::TextEditorActionHandler(Constants::ANDROID_MANIFEST_EDITOR_CONTEXT))
|
||||
: Core::IEditorFactory(parent)
|
||||
{
|
||||
setId(Constants::ANDROID_MANIFEST_EDITOR_ID);
|
||||
setDisplayName(tr("Android Manifest editor"));
|
||||
addMimeType(Constants::ANDROID_MANIFEST_MIME_TYPE);
|
||||
new TextEditor::TextEditorActionHandler(this, Constants::ANDROID_MANIFEST_EDITOR_CONTEXT);
|
||||
}
|
||||
|
||||
Core::IEditor *AndroidManifestEditorFactory::createEditor(QWidget *parent)
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
#include <coreplugin/editormanager/ieditorfactory.h>
|
||||
|
||||
namespace TextEditor { class TextEditorActionHandler; }
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
@@ -45,9 +43,6 @@ public:
|
||||
explicit AndroidManifestEditorFactory(QObject *parent = 0);
|
||||
|
||||
Core::IEditor *createEditor(QWidget *parent);
|
||||
|
||||
private:
|
||||
TextEditor::TextEditorActionHandler *m_actionHandler;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user