forked from qt-creator/qt-creator
ScxmlEditor: Simplify plugin setup
Change-Id: Ib28cca1c24780a710f6eae29d168203cbf235ef2 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -1,37 +1,35 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "scxmleditorplugin.h"
|
||||
|
||||
#include "scxmleditorfactory.h"
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <coreplugin/designmode.h>
|
||||
|
||||
using namespace Core;
|
||||
#include <memory>
|
||||
|
||||
namespace ScxmlEditor {
|
||||
namespace Internal {
|
||||
namespace ScxmlEditor::Internal {
|
||||
|
||||
class ScxmlEditorPluginPrivate
|
||||
class ScxmlEditorPlugin : public ExtensionSystem::IPlugin
|
||||
{
|
||||
public:
|
||||
ScxmlEditorFactory editorFactory;
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "ScxmlEditor.json")
|
||||
|
||||
private:
|
||||
void initialize() final
|
||||
{
|
||||
editorFactory = std::make_unique<ScxmlEditorFactory>();
|
||||
}
|
||||
|
||||
void extensionsInitialized() final
|
||||
{
|
||||
DesignMode::setDesignModeIsRequired();
|
||||
}
|
||||
|
||||
std::unique_ptr<ScxmlEditorFactory> editorFactory;
|
||||
};
|
||||
|
||||
ScxmlEditorPlugin::~ScxmlEditorPlugin()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
} // ScxmlEditor::Internal
|
||||
|
||||
void ScxmlEditorPlugin::initialize()
|
||||
{
|
||||
d = new ScxmlEditorPluginPrivate;
|
||||
}
|
||||
|
||||
void ScxmlEditorPlugin::extensionsInitialized()
|
||||
{
|
||||
DesignMode::setDesignModeIsRequired();
|
||||
}
|
||||
|
||||
} // Internal
|
||||
} // ScxmlEditor
|
||||
#include "scxmleditorplugin.moc"
|
||||
|
||||
Reference in New Issue
Block a user