forked from qt-creator/qt-creator
CppCheck: Hide plugin class definition in .cpp
Change-Id: I960ec6e0e4d63cf0edf7af55d191ba666f44739b Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -8,7 +8,7 @@ add_qtc_plugin(Cppcheck
|
||||
cppcheckdiagnosticsmodel.cpp cppcheckdiagnosticsmodel.h
|
||||
cppcheckdiagnosticview.cpp cppcheckdiagnosticview.h
|
||||
cppcheckmanualrundialog.cpp cppcheckmanualrundialog.h
|
||||
cppcheckplugin.cpp cppcheckplugin.h
|
||||
cppcheckplugin.cpp
|
||||
cppcheckrunner.cpp cppcheckrunner.h
|
||||
cppchecksettings.cpp cppchecksettings.h
|
||||
cppchecktextmark.cpp cppchecktextmark.h
|
||||
|
||||
@@ -24,7 +24,6 @@ QtcPlugin {
|
||||
"cppcheckmanualrundialog.cpp",
|
||||
"cppcheckmanualrundialog.h",
|
||||
"cppcheckplugin.cpp",
|
||||
"cppcheckplugin.h",
|
||||
"cppcheckrunner.cpp",
|
||||
"cppcheckrunner.h",
|
||||
"cppchecksettings.cpp",
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright (C) 2018 Sergey Morozov
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "cppcheckplugin.h"
|
||||
|
||||
#include "cppcheckconstants.h"
|
||||
#include "cppcheckdiagnosticview.h"
|
||||
#include "cppchecksettings.h"
|
||||
@@ -13,6 +11,14 @@
|
||||
#include "cppcheckdiagnosticsmodel.h"
|
||||
#include "cppcheckmanualrundialog.h"
|
||||
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
|
||||
#include <debugger/analyzer/analyzerconstants.h>
|
||||
#include <debugger/debuggermainwindow.h>
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <projectexplorer/kitaspects.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
@@ -20,12 +26,6 @@
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
|
||||
#include <debugger/analyzer/analyzerconstants.h>
|
||||
#include <debugger/debuggermainwindow.h>
|
||||
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/utilsicons.h>
|
||||
@@ -139,12 +139,13 @@ void CppcheckPluginPrivate::updateManualRunAction()
|
||||
manualRunAction->setEnabled(canRun);
|
||||
}
|
||||
|
||||
CppcheckPlugin::CppcheckPlugin() = default;
|
||||
|
||||
CppcheckPlugin::~CppcheckPlugin() = default;
|
||||
|
||||
void CppcheckPlugin::initialize()
|
||||
class CppcheckPlugin final : public ExtensionSystem::IPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Cppcheck.json")
|
||||
|
||||
void initialize() final
|
||||
{
|
||||
d.reset(new CppcheckPluginPrivate);
|
||||
|
||||
using namespace Core;
|
||||
@@ -163,6 +164,11 @@ void CppcheckPlugin::initialize()
|
||||
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::runActionsUpdated,
|
||||
d.get(), &CppcheckPluginPrivate::updateManualRunAction);
|
||||
d->updateManualRunAction();
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<CppcheckPluginPrivate> d;
|
||||
};
|
||||
|
||||
} // Cppcheck::Internal
|
||||
|
||||
#include "cppcheckplugin.moc"
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
// Copyright (C) 2018 Sergey Morozov
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace Cppcheck::Internal {
|
||||
|
||||
class CppcheckPluginPrivate;
|
||||
|
||||
class CppcheckPlugin final : public ExtensionSystem::IPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Cppcheck.json")
|
||||
|
||||
public:
|
||||
CppcheckPlugin();
|
||||
~CppcheckPlugin() override;
|
||||
|
||||
private:
|
||||
void initialize() final;
|
||||
|
||||
std::unique_ptr<CppcheckPluginPrivate> d;
|
||||
};
|
||||
|
||||
} // Cppcheck
|
||||
Reference in New Issue
Block a user