aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scxmleditor
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2018-02-08 09:42:38 +0100
committerhjk <hjk@qt.io>2018-02-08 09:10:54 +0000
commit5efd576020a5407cd09a86112e5655e621e9d53f (patch)
treeb3f54e4d7323550f10c8ec289ba09a20ba24f73d /src/plugins/scxmleditor
parentabe57f73b4acbeabe144a987b0b128c498e5d482 (diff)
ScxmlEditor: Avoid use of global object pool
Including some code cosmetics. Change-Id: I6d7f11404ea489020d0c74e43cbe25cdcaa48e85 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/scxmleditor')
-rw-r--r--src/plugins/scxmleditor/scxmleditorfactory.cpp3
-rw-r--r--src/plugins/scxmleditor/scxmleditorfactory.h2
-rw-r--r--src/plugins/scxmleditor/scxmleditorplugin.cpp25
-rw-r--r--src/plugins/scxmleditor/scxmleditorplugin.h9
4 files changed, 12 insertions, 27 deletions
diff --git a/src/plugins/scxmleditor/scxmleditorfactory.cpp b/src/plugins/scxmleditor/scxmleditorfactory.cpp
index 6a923237d13..013ce959e72 100644
--- a/src/plugins/scxmleditor/scxmleditorfactory.cpp
+++ b/src/plugins/scxmleditor/scxmleditorfactory.cpp
@@ -38,7 +38,8 @@
using namespace ScxmlEditor::Constants;
using namespace ScxmlEditor::Internal;
-ScxmlEditorFactory::ScxmlEditorFactory()
+ScxmlEditorFactory::ScxmlEditorFactory(QObject *parent)
+ : IEditorFactory(parent)
{
setId(K_SCXML_EDITOR_ID);
setDisplayName(QCoreApplication::translate("ScxmlEditor", C_SCXMLEDITOR_DISPLAY_NAME));
diff --git a/src/plugins/scxmleditor/scxmleditorfactory.h b/src/plugins/scxmleditor/scxmleditorfactory.h
index 1e621e0615c..8732d94acc7 100644
--- a/src/plugins/scxmleditor/scxmleditorfactory.h
+++ b/src/plugins/scxmleditor/scxmleditorfactory.h
@@ -37,7 +37,7 @@ class ScxmlEditorFactory : public Core::IEditorFactory
Q_OBJECT
public:
- explicit ScxmlEditorFactory();
+ explicit ScxmlEditorFactory(QObject *parent);
Core::IEditor *createEditor() override;
diff --git a/src/plugins/scxmleditor/scxmleditorplugin.cpp b/src/plugins/scxmleditor/scxmleditorplugin.cpp
index 30bddf6b2f8..d8b1514a178 100644
--- a/src/plugins/scxmleditor/scxmleditorplugin.cpp
+++ b/src/plugins/scxmleditor/scxmleditorplugin.cpp
@@ -24,34 +24,21 @@
****************************************************************************/
#include "scxmleditorplugin.h"
-#include "scxmleditorconstants.h"
#include "scxmleditorfactory.h"
-#include <coreplugin/coreconstants.h>
#include <coreplugin/designmode.h>
-#include <coreplugin/icontext.h>
-#include <coreplugin/icore.h>
-
-#include <QAction>
-#include <QMainWindow>
-#include <QMenu>
-#include <QMessageBox>
-
-#include <QtPlugin>
using namespace Core;
-using namespace ScxmlEditor::Internal;
-ScxmlEditorPlugin::ScxmlEditorPlugin()
-{
-}
+namespace ScxmlEditor {
+namespace Internal {
bool ScxmlEditorPlugin::initialize(const QStringList &arguments, QString *errorString)
{
Q_UNUSED(arguments)
Q_UNUSED(errorString)
- addAutoReleasedObject(new ScxmlEditorFactory);
+ (void) new ScxmlEditorFactory(this);
return true;
}
@@ -61,7 +48,5 @@ void ScxmlEditorPlugin::extensionsInitialized()
DesignMode::setDesignModeIsRequired();
}
-ExtensionSystem::IPlugin::ShutdownFlag ScxmlEditorPlugin::aboutToShutdown()
-{
- return SynchronousShutdown;
-}
+} // Internal
+} // ScxmlEditor
diff --git a/src/plugins/scxmleditor/scxmleditorplugin.h b/src/plugins/scxmleditor/scxmleditorplugin.h
index 71e8552ccf0..55555773739 100644
--- a/src/plugins/scxmleditor/scxmleditorplugin.h
+++ b/src/plugins/scxmleditor/scxmleditorplugin.h
@@ -22,7 +22,6 @@
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
-#include "scxmleditor_global.h"
#include <extensionsystem/iplugin.h>
@@ -35,11 +34,11 @@ class ScxmlEditorPlugin : public ExtensionSystem::IPlugin
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ScxmlEditor.json")
public:
- ScxmlEditorPlugin();
+ ScxmlEditorPlugin() = default;
- bool initialize(const QStringList &arguments, QString *errorString) override;
- void extensionsInitialized() override;
- ShutdownFlag aboutToShutdown() override;
+private:
+ bool initialize(const QStringList &arguments, QString *errorString) final;
+ void extensionsInitialized() final;
};
} // namespace Internal