diff --git a/src/plugins/compilerexplorer/CMakeLists.txt b/src/plugins/compilerexplorer/CMakeLists.txt index 1c5608234b5..4df45f95f30 100644 --- a/src/plugins/compilerexplorer/CMakeLists.txt +++ b/src/plugins/compilerexplorer/CMakeLists.txt @@ -17,7 +17,6 @@ add_qtc_plugin(CompilerExplorer compilerexploreraspects.cpp compilerexploreraspects.h compilerexplorerplugin.cpp - compilerexplorerplugin.h compilerexplorertr.h compilerexplorereditor.cpp compilerexplorereditor.h diff --git a/src/plugins/compilerexplorer/compilerexplorer.qbs b/src/plugins/compilerexplorer/compilerexplorer.qbs index 486d2c4931e..88fda3bf616 100644 --- a/src/plugins/compilerexplorer/compilerexplorer.qbs +++ b/src/plugins/compilerexplorer/compilerexplorer.qbs @@ -30,7 +30,6 @@ QtcPlugin { "compilerexploreroptions.cpp", "compilerexploreroptions.h", "compilerexplorerplugin.cpp", - "compilerexplorerplugin.h", "compilerexplorersettings.cpp", "compilerexplorersettings.h", "compilerexplorertr.h", diff --git a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp index 44a3e3fafc8..f87dd780b1c 100644 --- a/src/plugins/compilerexplorer/compilerexplorerplugin.cpp +++ b/src/plugins/compilerexplorer/compilerexplorerplugin.cpp @@ -1,8 +1,6 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include "compilerexplorerplugin.h" - #include "compilerexplorerconstants.h" #include "compilerexplorereditor.h" #include "compilerexplorersettings.h" @@ -18,39 +16,45 @@ #include -namespace CompilerExplorer { -namespace Internal { +#include -CompilerExplorerPlugin::CompilerExplorerPlugin() {} +using namespace Core; -CompilerExplorerPlugin::~CompilerExplorerPlugin() {} +namespace CompilerExplorer::Internal { -void CompilerExplorerPlugin::initialize() +class CompilerExplorerPlugin : public ExtensionSystem::IPlugin { - static CompilerExplorer::EditorFactory ceEditorFactory; + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CompilerExplorer.json") - auto action = new QAction(Tr::tr("Open Compiler Explorer"), this); - connect(action, &QAction::triggered, this, [] { - CompilerExplorer::Settings settings; +public: + CompilerExplorerPlugin(); + ~CompilerExplorerPlugin() override; - const QString src = settings.source(); - QString name("Compiler Explorer"); - Core::EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID, &name, src.toUtf8()); - }); + void initialize() override + { + static CompilerExplorer::EditorFactory ceEditorFactory; - Core::ActionContainer *mtools = Core::ActionManager::actionContainer(Core::Constants::M_TOOLS); - Core::ActionContainer *mCompilerExplorer = Core::ActionManager::createMenu( - "Tools.CompilerExplorer"); - QMenu *menu = mCompilerExplorer->menu(); - menu->setTitle(Tr::tr("Compiler Explorer")); - mtools->addMenu(mCompilerExplorer); + auto action = new QAction(Tr::tr("Open Compiler Explorer"), this); + connect(action, &QAction::triggered, this, [] { + CompilerExplorer::Settings settings; - Core::Command *cmd - = Core::ActionManager::registerAction(action, "CompilerExplorer.CompilerExplorerAction"); - mCompilerExplorer->addAction(cmd); -} + const QString src = settings.source(); + QString name("Compiler Explorer"); + EditorManager::openEditorWithContents(Constants::CE_EDITOR_ID, &name, src.toUtf8()); + }); -void CompilerExplorerPlugin::extensionsInitialized() {} + ActionContainer *mtools = ActionManager::actionContainer(Core::Constants::M_TOOLS); + ActionContainer *mCompilerExplorer = ActionManager::createMenu("Tools.CompilerExplorer"); + QMenu *menu = mCompilerExplorer->menu(); + menu->setTitle(Tr::tr("Compiler Explorer")); + mtools->addMenu(mCompilerExplorer); -} // namespace Internal -} // namespace CompilerExplorer + Command *cmd = ActionManager::registerAction(action, "CompilerExplorer.CompilerExplorerAction"); + mCompilerExplorer->addAction(cmd); + } +}; + +} // CompilerExplorer::Internl + +#include "compilerexplorerplugin.moc" diff --git a/src/plugins/compilerexplorer/compilerexplorerplugin.h b/src/plugins/compilerexplorer/compilerexplorerplugin.h deleted file mode 100644 index 8379a2c8e0f..00000000000 --- a/src/plugins/compilerexplorer/compilerexplorerplugin.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2023 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -#pragma once - -#include - -namespace CompilerExplorer::Internal { - -class CompilerExplorerPlugin : public ExtensionSystem::IPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "CompilerExplorer.json") - -public: - CompilerExplorerPlugin(); - ~CompilerExplorerPlugin() override; - - void initialize() override; - - void extensionsInitialized() override; -}; - -} // namespace CompilerExplorer::Internal