diff options
author | hjk <hjk@qt.io> | 2018-02-02 16:08:39 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2018-02-02 16:39:06 +0000 |
commit | 3d79d80557ac63b1ba0f11a3da5496ea77500bce (patch) | |
tree | 31672915ee825e60db91cffcacabd89dd76fb9fd | |
parent | 93a5aa98212db6c30d65cd8c5d3106aaa2b6ce54 (diff) | |
download | qt-creator-3d79d80557ac63b1ba0f11a3da5496ea77500bce.tar.gz |
Macros: Avoid use of global object pool
Change-Id: I84eb19e3e081fd63d390b7ae065c138bb483201f
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Reviewed-by: hjk <hjk@qt.io>
-rw-r--r-- | src/plugins/macros/macrolocatorfilter.cpp | 4 | ||||
-rw-r--r-- | src/plugins/macros/macrolocatorfilter.h | 4 | ||||
-rw-r--r-- | src/plugins/macros/macrosplugin.cpp | 4 |
3 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/macros/macrolocatorfilter.cpp b/src/plugins/macros/macrolocatorfilter.cpp index 99567a663c..ddeb98ba6b 100644 --- a/src/plugins/macros/macrolocatorfilter.cpp +++ b/src/plugins/macros/macrolocatorfilter.cpp @@ -37,8 +37,8 @@ using namespace Macros; using namespace Macros::Internal; -MacroLocatorFilter::MacroLocatorFilter(): - m_icon(QPixmap(":/macros/images/macro.png")) +MacroLocatorFilter::MacroLocatorFilter(QObject *parent) + : Core::ILocatorFilter(parent), m_icon(QPixmap(":/macros/images/macro.png")) { setId("Macros"); setDisplayName(tr("Text Editing Macros")); diff --git a/src/plugins/macros/macrolocatorfilter.h b/src/plugins/macros/macrolocatorfilter.h index d16553db3a..6105122db4 100644 --- a/src/plugins/macros/macrolocatorfilter.h +++ b/src/plugins/macros/macrolocatorfilter.h @@ -30,8 +30,6 @@ #include <QIcon> namespace Macros { - - namespace Internal { class MacroLocatorFilter : public Core::ILocatorFilter @@ -39,7 +37,7 @@ class MacroLocatorFilter : public Core::ILocatorFilter Q_OBJECT public: - MacroLocatorFilter(); + explicit MacroLocatorFilter(QObject *parent); ~MacroLocatorFilter(); QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future, diff --git a/src/plugins/macros/macrosplugin.cpp b/src/plugins/macros/macrosplugin.cpp index d24d7300c4..04c73425f2 100644 --- a/src/plugins/macros/macrosplugin.cpp +++ b/src/plugins/macros/macrosplugin.cpp @@ -58,8 +58,8 @@ bool MacrosPlugin::initialize(const QStringList &arguments, QString *errorMessag Q_UNUSED(arguments); Q_UNUSED(errorMessage); - addAutoReleasedObject(new MacroOptionsPage); - addAutoReleasedObject(new MacroLocatorFilter); + new MacroOptionsPage(this); + new MacroLocatorFilter(this); Core::Context textContext(TextEditor::Constants::C_TEXTEDITOR); m_macroManager = new MacroManager(this); |