CppCheck: Use new settings pattern

Change-Id: Ia2de8e684690ab7bfbdcf7ba417df1f2174433de
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-07-17 08:44:12 +02:00
parent bce9b9ffaa
commit 8e7ac2e59d
5 changed files with 64 additions and 41 deletions

View File

@@ -5,6 +5,7 @@
#include "cppcheckconstants.h"
#include "cppcheckdiagnosticview.h"
#include "cppcheckoptions.h"
#include "cppchecktextmarkmanager.h"
#include "cppchecktool.h"
#include "cppchecktr.h"
@@ -39,11 +40,10 @@ public:
explicit CppcheckPluginPrivate();
CppcheckTextMarkManager marks;
CppcheckOptions options;
CppcheckTool tool{options, marks, Constants::CHECK_PROGRESS_ID};
CppcheckTool tool{marks, Constants::CHECK_PROGRESS_ID};
CppcheckTrigger trigger{marks, tool};
DiagnosticsModel manualRunModel;
CppcheckTool manualRunTool{options, manualRunModel, Constants::MANUAL_CHECK_PROGRESS_ID};
CppcheckTool manualRunTool{manualRunModel, Constants::MANUAL_CHECK_PROGRESS_ID};
Utils::Perspective perspective{Constants::PERSPECTIVE_ID, ::Cppcheck::Tr::tr("Cppcheck")};
QAction *manualRunAction;
@@ -55,7 +55,7 @@ public:
CppcheckPluginPrivate::CppcheckPluginPrivate()
{
tool.updateOptions();
connect(&options, &AspectContainer::changed, [this] {
connect(&settings(), &AspectContainer::changed, [this] {
tool.updateOptions();
trigger.recheck();
});
@@ -112,7 +112,7 @@ void CppcheckPluginPrivate::startManualRun()
manualRunTool.updateOptions();
auto optionsWidget = options.layouter()().emerge();
auto optionsWidget = settings().layouter()().emerge();
ManualRunDialog dialog(optionsWidget, project);
if (dialog.exec() == ManualRunDialog::Rejected)