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 <QAction>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
@@ -39,7 +38,6 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/id.h>
|
#include <coreplugin/id.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
|
||||||
|
|
||||||
namespace ImageViewer {
|
namespace ImageViewer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -51,8 +49,8 @@ bool ImageViewerPlugin::initialize(const QStringList &arguments, QString *errorM
|
|||||||
Q_UNUSED(arguments)
|
Q_UNUSED(arguments)
|
||||||
Q_UNUSED(errorMessage)
|
Q_UNUSED(errorMessage)
|
||||||
|
|
||||||
m_factory = new ImageViewerFactory(this);
|
(void) new ImageViewerFactory(this);
|
||||||
addAutoReleasedObject(m_factory);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -29,8 +29,6 @@
|
|||||||
#include <extensionsystem/iplugin.h>
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
#include <QPointer>
|
|
||||||
#include <QtPlugin>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QAction;
|
class QAction;
|
||||||
@@ -41,24 +39,20 @@ namespace Core { class Id; }
|
|||||||
namespace ImageViewer {
|
namespace ImageViewer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ImageViewerFactory;
|
|
||||||
|
|
||||||
class ImageViewerPlugin : public ExtensionSystem::IPlugin
|
class ImageViewerPlugin : public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ImageViewer.json")
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ImageViewer.json")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ImageViewerPlugin() {}
|
ImageViewerPlugin() = default;
|
||||||
|
|
||||||
bool initialize(const QStringList &arguments, QString *errorMessage = 0);
|
|
||||||
void extensionsInitialized();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool initialize(const QStringList &arguments, QString *errorMessage) final;
|
||||||
|
void extensionsInitialized() final;
|
||||||
|
|
||||||
QAction *registerNewAction(Core::Id id, const QString &title = QString(),
|
QAction *registerNewAction(Core::Id id, const QString &title = QString(),
|
||||||
const QKeySequence &key = QKeySequence());
|
const QKeySequence &key = QKeySequence());
|
||||||
|
|
||||||
QPointer<ImageViewerFactory> m_factory;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user