From 4096166e6643f9b4a1169d3dad27f84484c7fa12 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 8 Jun 2014 18:56:40 +0200 Subject: [PATCH] Remove sheet builder action when unloading the plugin. --- .../ovqt_sheet_builder/ovqt_sheet_builder.cpp | 12 ++++++++++++ .../plugins/ovqt_sheet_builder/ovqt_sheet_builder.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp b/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp index 4fd7dfb11..8ea90fdc5 100644 --- a/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp +++ b/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp @@ -35,6 +35,18 @@ using namespace Plugin; +SheetBuilderPlugin::SheetBuilderPlugin() +{ +} + +SheetBuilderPlugin::~SheetBuilderPlugin() +{ + Core::MenuManager *menuManager = Core::ICore::instance()->menuManager(); + QAction *a = menuManager->action( "SheetBuilder" ); + menuManager->unregisterAction( "SheetBuilder" ); + delete a; +} + bool SheetBuilderPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); diff --git a/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h b/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h index 504d0914d..21e2855c1 100644 --- a/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h +++ b/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h @@ -36,6 +36,8 @@ class SheetBuilderPlugin : public QObject, public ExtensionSystem::IPlugin Q_OBJECT Q_INTERFACES(ExtensionSystem::IPlugin) public: + SheetBuilderPlugin(); + ~SheetBuilderPlugin(); bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); void setNelContext(NLMISC::INelContext *nelContext);