forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user