diff options
author | hjk <hjk@qt.io> | 2018-02-08 09:00:30 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2018-02-08 08:22:59 +0000 |
commit | 231b4329df8874f4ff55fc016890a2ea7520b6fe (patch) | |
tree | 12747c735375d234922a4aade3f626fceacf3531 /src/plugins/imageviewer | |
parent | 2bfec17bef59a0f07c873614034288bb169b92cc (diff) | |
download | qt-creator-231b4329df8874f4ff55fc016890a2ea7520b6fe.tar.gz |
ImageViewer: Remove unneeded use of global object pool
Plus some code cosmetics.
Change-Id: I4e10f1900a5a06bb37bc2d20f3dd776c7534011e
Reviewed-by: Denis Mingulov <denis@mingulov.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/imageviewer')
-rw-r--r-- | src/plugins/imageviewer/imageviewerplugin.cpp | 6 | ||||
-rw-r--r-- | src/plugins/imageviewer/imageviewerplugin.h | 14 |
2 files changed, 6 insertions, 14 deletions
diff --git a/src/plugins/imageviewer/imageviewerplugin.cpp b/src/plugins/imageviewer/imageviewerplugin.cpp index dbed73f082..1e2a493a0f 100644 --- a/src/plugins/imageviewer/imageviewerplugin.cpp +++ b/src/plugins/imageviewer/imageviewerplugin.cpp @@ -31,7 +31,6 @@ #include <QAction> #include <QCoreApplication> -#include <QDebug> #include <coreplugin/icore.h> #include <coreplugin/actionmanager/actionmanager.h> @@ -39,7 +38,6 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/id.h> -#include <extensionsystem/pluginmanager.h> namespace ImageViewer { namespace Internal { @@ -51,8 +49,8 @@ bool ImageViewerPlugin::initialize(const QStringList &arguments, QString *errorM Q_UNUSED(arguments) Q_UNUSED(errorMessage) - m_factory = new ImageViewerFactory(this); - addAutoReleasedObject(m_factory); + (void) new ImageViewerFactory(this); + return true; } diff --git a/src/plugins/imageviewer/imageviewerplugin.h b/src/plugins/imageviewer/imageviewerplugin.h index 88d671a3e9..91c24ef188 100644 --- a/src/plugins/imageviewer/imageviewerplugin.h +++ b/src/plugins/imageviewer/imageviewerplugin.h @@ -29,8 +29,6 @@ #include <extensionsystem/iplugin.h> #include <QKeySequence> -#include <QPointer> -#include <QtPlugin> QT_BEGIN_NAMESPACE class QAction; @@ -41,24 +39,20 @@ namespace Core { class Id; } namespace ImageViewer { namespace Internal { -class ImageViewerFactory; - class ImageViewerPlugin : public ExtensionSystem::IPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ImageViewer.json") public: - ImageViewerPlugin() {} - - bool initialize(const QStringList &arguments, QString *errorMessage = 0); - void extensionsInitialized(); + ImageViewerPlugin() = default; private: + bool initialize(const QStringList &arguments, QString *errorMessage) final; + void extensionsInitialized() final; + QAction *registerNewAction(Core::Id id, const QString &title = QString(), const QKeySequence &key = QKeySequence()); - - QPointer<ImageViewerFactory> m_factory; }; } // namespace Internal |