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:
Eike Ziller
2013-12-10 17:13:21 +01:00
parent 3d1b70c58e
commit d80fb696ab
27 changed files with 48 additions and 106 deletions

View File

@@ -197,7 +197,6 @@ static void copyIdentifiers(const char * const words[], size_t bytesCount, QSet<
PythonEditorPlugin::PythonEditorPlugin()
: m_factory(0)
, m_actionHandler(0)
{
m_instance = this;
copyIdentifiers(LIST_OF_PYTHON_KEYWORDS, sizeof(LIST_OF_PYTHON_KEYWORDS), m_keywords);
@@ -222,12 +221,6 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error
addObject(m_factory);
// Initialize editor actions handler
m_actionHandler = new TextEditor::TextEditorActionHandler(
C_PYTHONEDITOR_ID,
TextEditor::TextEditorActionHandler::Format
| TextEditor::TextEditorActionHandler::UnCommentSelection
| TextEditor::TextEditorActionHandler::UnCollapseAll);
// Add MIME overlay icons (these icons displayed at Project dock panel)
const QIcon icon = QIcon::fromTheme(QLatin1String(C_PY_MIME_ICON));
if (!icon.isNull())