diff options
author | hjk <hjk@qt.io> | 2023-05-26 10:33:02 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2023-05-26 09:19:25 +0000 |
commit | b0b80c539bdb5968e176a2a39e3aa72aea8276ec (patch) | |
tree | f9af197e0696d0bb5ea50cdcd4734ef8d01b6b7d /src/plugins/cppcheck | |
parent | 60da3a024a0412c39470181f4f25fe08c4a60582 (diff) |
CppCheck: Register settingsaspect more directly
Change-Id: I325c7329618b4dbdd36bb1464627806e5f116bc0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cppcheck')
-rw-r--r-- | src/plugins/cppcheck/cppcheckoptions.cpp | 15 | ||||
-rw-r--r-- | src/plugins/cppcheck/cppcheckoptions.h | 35 |
2 files changed, 16 insertions, 34 deletions
diff --git a/src/plugins/cppcheck/cppcheckoptions.cpp b/src/plugins/cppcheck/cppcheckoptions.cpp index 22f728f8f11..8392f64600c 100644 --- a/src/plugins/cppcheck/cppcheckoptions.cpp +++ b/src/plugins/cppcheck/cppcheckoptions.cpp @@ -34,7 +34,6 @@ CppcheckOptions::CppcheckOptions() setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER); setSettingsGroup("Cppcheck"); - registerAspect(&binary); binary.setSettingsKey("binary"); binary.setExpectedKind(PathChooser::ExistingCommand); binary.setCommandVersionArguments({"--version"}); @@ -48,71 +47,57 @@ CppcheckOptions::CppcheckOptions() binary.setDefaultValue(programFiles.pathAppended("Cppcheck/cppcheck.exe").toString()); } - registerAspect(&warning); warning.setSettingsKey("warning"); warning.setDefaultValue(true); warning.setLabelText(Tr::tr("Warnings")); - registerAspect(&style); style.setSettingsKey("style"); style.setDefaultValue(true); style.setLabelText(Tr::tr("Style")); - registerAspect(&performance); performance.setSettingsKey("performance"); performance.setDefaultValue(true); performance.setLabelText(Tr::tr("Performance")); - registerAspect(&portability); portability.setSettingsKey("portability"); portability.setDefaultValue(true); portability.setLabelText(Tr::tr("Portability")); - registerAspect(&information); information.setSettingsKey("information"); information.setDefaultValue(true); information.setLabelText(Tr::tr("Information")); - registerAspect(&unusedFunction); unusedFunction.setSettingsKey("unusedFunction"); unusedFunction.setLabelText(Tr::tr("Unused functions")); unusedFunction.setToolTip(Tr::tr("Disables multithreaded check.")); - registerAspect(&missingInclude); missingInclude.setSettingsKey("missingInclude"); missingInclude.setLabelText(Tr::tr("Missing includes")); - registerAspect(&inconclusive); inconclusive.setSettingsKey("inconclusive"); inconclusive.setLabelText(Tr::tr("Inconclusive errors")); - registerAspect(&forceDefines); forceDefines.setSettingsKey("forceDefines"); forceDefines.setLabelText(Tr::tr("Check all define combinations")); - registerAspect(&customArguments); customArguments.setSettingsKey("customArguments"); customArguments.setDisplayStyle(StringAspect::LineEditDisplay); customArguments.setLabelText(Tr::tr("Custom arguments:")); - registerAspect(&ignoredPatterns); ignoredPatterns.setSettingsKey("ignoredPatterns"); ignoredPatterns.setDisplayStyle(StringAspect::LineEditDisplay); ignoredPatterns.setLabelText(Tr::tr("Ignored file patterns:")); ignoredPatterns.setToolTip(Tr::tr("Comma-separated wildcards of full file paths. " "Files still can be checked if others include them.")); - registerAspect(&showOutput); showOutput.setSettingsKey("showOutput"); showOutput.setLabelText(Tr::tr("Show raw output")); - registerAspect(&addIncludePaths); addIncludePaths.setSettingsKey("addIncludePaths"); addIncludePaths.setLabelText(Tr::tr("Add include paths")); addIncludePaths.setToolTip(Tr::tr("Can find missing includes but makes " "checking slower. Use only when needed.")); - registerAspect(&guessArguments); guessArguments.setSettingsKey("guessArguments"); guessArguments.setDefaultValue(true); guessArguments.setLabelText(Tr::tr("Calculate additional arguments")); diff --git a/src/plugins/cppcheck/cppcheckoptions.h b/src/plugins/cppcheck/cppcheckoptions.h index 5a617b1241c..a6ccdd98ba0 100644 --- a/src/plugins/cppcheck/cppcheckoptions.h +++ b/src/plugins/cppcheck/cppcheckoptions.h @@ -7,9 +7,6 @@ namespace Cppcheck::Internal { -class CppcheckTool; -class CppcheckTrigger; - class CppcheckOptions final : public Core::PagedSettings { public: @@ -17,22 +14,22 @@ public: std::function<void(QWidget *widget)> layouter(); - Utils::FilePathAspect binary; - Utils::BoolAspect warning; - Utils::BoolAspect style; - Utils::BoolAspect performance; - Utils::BoolAspect portability; - Utils::BoolAspect information; - Utils::BoolAspect unusedFunction; - Utils::BoolAspect missingInclude; - Utils::BoolAspect inconclusive; - Utils::BoolAspect forceDefines; - - Utils::StringAspect customArguments; - Utils::StringAspect ignoredPatterns; - Utils::BoolAspect showOutput; - Utils::BoolAspect addIncludePaths; - Utils::BoolAspect guessArguments; + Utils::FilePathAspect binary{this}; + Utils::BoolAspect warning{this}; + Utils::BoolAspect style{this}; + Utils::BoolAspect performance{this}; + Utils::BoolAspect portability{this}; + Utils::BoolAspect information{this}; + Utils::BoolAspect unusedFunction{this}; + Utils::BoolAspect missingInclude{this}; + Utils::BoolAspect inconclusive{this}; + Utils::BoolAspect forceDefines{this}; + + Utils::StringAspect customArguments{this}; + Utils::StringAspect ignoredPatterns{this}; + Utils::BoolAspect showOutput{this}; + Utils::BoolAspect addIncludePaths{this}; + Utils::BoolAspect guessArguments{this}; }; } // Cppcheck::Internal |