summaryrefslogtreecommitdiff
path: root/src/plugins/cppcheck/cppcheckoptions.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2023-01-09 18:08:30 +0100
committerhjk <hjk@qt.io>2023-01-10 10:20:03 +0000
commit0a0dd9ea31d03fcc57f51de724c32e8ca3fe3d3f (patch)
tree0638e4eac110678c2d134d4e78aef5974e4f87bc /src/plugins/cppcheck/cppcheckoptions.cpp
parent677fd6ba9a91add241447a067c65f46c61b2af94 (diff)
downloadqt-creator-0a0dd9ea31d03fcc57f51de724c32e8ca3fe3d3f.tar.gz
CppCheck: Tr::tr and code cosmetics
Change-Id: I5e6583984f7dc94e998df3c20840f2ba2e801ab8 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/cppcheck/cppcheckoptions.cpp')
-rw-r--r--src/plugins/cppcheck/cppcheckoptions.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/plugins/cppcheck/cppcheckoptions.cpp b/src/plugins/cppcheck/cppcheckoptions.cpp
index c9304d4f8e..e78f2d59fe 100644
--- a/src/plugins/cppcheck/cppcheckoptions.cpp
+++ b/src/plugins/cppcheck/cppcheckoptions.cpp
@@ -1,9 +1,11 @@
// Copyright (C) 2018 Sergey Morozov
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-#include "cppcheckconstants.h"
#include "cppcheckoptions.h"
+
+#include "cppcheckconstants.h"
#include "cppchecktool.h"
+#include "cppchecktr.h"
#include "cppchecktrigger.h"
#include <utils/environment.h>
@@ -22,26 +24,25 @@
using namespace Utils;
-namespace Cppcheck {
-namespace Internal {
+namespace Cppcheck::Internal {
OptionsWidget::OptionsWidget(QWidget *parent)
: QWidget(parent),
m_binary(new Utils::PathChooser(this)),
m_customArguments(new QLineEdit(this)),
m_ignorePatterns(new QLineEdit(this)),
- m_warning(new QCheckBox(tr("Warnings"), this)),
- m_style(new QCheckBox(tr("Style"), this)),
- m_performance(new QCheckBox(tr("Performance"), this)),
- m_portability(new QCheckBox(tr("Portability"), this)),
- m_information(new QCheckBox(tr("Information"), this)),
- m_unusedFunction(new QCheckBox(tr("Unused functions"), this)),
- m_missingInclude(new QCheckBox(tr("Missing includes"), this)),
- m_inconclusive(new QCheckBox(tr("Inconclusive errors"), this)),
- m_forceDefines(new QCheckBox(tr("Check all define combinations"), this)),
- m_showOutput(new QCheckBox(tr("Show raw output"), this)),
- m_addIncludePaths(new QCheckBox(tr("Add include paths"), this)),
- m_guessArguments(new QCheckBox(tr("Calculate additional arguments"), this))
+ m_warning(new QCheckBox(Tr::tr("Warnings"), this)),
+ m_style(new QCheckBox(Tr::tr("Style"), this)),
+ m_performance(new QCheckBox(Tr::tr("Performance"), this)),
+ m_portability(new QCheckBox(Tr::tr("Portability"), this)),
+ m_information(new QCheckBox(Tr::tr("Information"), this)),
+ m_unusedFunction(new QCheckBox(Tr::tr("Unused functions"), this)),
+ m_missingInclude(new QCheckBox(Tr::tr("Missing includes"), this)),
+ m_inconclusive(new QCheckBox(Tr::tr("Inconclusive errors"), this)),
+ m_forceDefines(new QCheckBox(Tr::tr("Check all define combinations"), this)),
+ m_showOutput(new QCheckBox(Tr::tr("Show raw output"), this)),
+ m_addIncludePaths(new QCheckBox(Tr::tr("Add include paths"), this)),
+ m_guessArguments(new QCheckBox(Tr::tr("Calculate additional arguments"), this))
{
m_binary->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_binary->setCommandVersionArguments({"--version"});
@@ -49,18 +50,18 @@ OptionsWidget::OptionsWidget(QWidget *parent)
auto variableChooser = new Utils::VariableChooser(this);
variableChooser->addSupportedWidget (m_customArguments);
- m_unusedFunction->setToolTip(tr("Disables multithreaded check."));
- m_ignorePatterns->setToolTip(tr("Comma-separated wildcards of full file paths. "
- "Files still can be checked if others include them."));
- m_addIncludePaths->setToolTip(tr("Can find missing includes but makes "
- "checking slower. Use only when needed."));
- m_guessArguments->setToolTip(tr("Like C++ standard and language."));
+ m_unusedFunction->setToolTip(Tr::tr("Disables multithreaded check."));
+ m_ignorePatterns->setToolTip(Tr::tr("Comma-separated wildcards of full file paths. "
+ "Files still can be checked if others include them."));
+ m_addIncludePaths->setToolTip(Tr::tr("Can find missing includes but makes "
+ "checking slower. Use only when needed."));
+ m_guessArguments->setToolTip(Tr::tr("Like C++ standard and language."));
auto layout = new QFormLayout(this);
- layout->addRow(tr("Binary:"), m_binary);
+ layout->addRow(Tr::tr("Binary:"), m_binary);
auto checks = new Utils::FlowLayout;
- layout->addRow(tr("Checks:"), checks);
+ layout->addRow(Tr::tr("Checks:"), checks);
checks->addWidget(m_warning);
checks->addWidget(m_style);
checks->addWidget(m_performance);
@@ -69,8 +70,8 @@ OptionsWidget::OptionsWidget(QWidget *parent)
checks->addWidget(m_unusedFunction);
checks->addWidget(m_missingInclude);
- layout->addRow(tr("Custom arguments:"), m_customArguments);
- layout->addRow(tr("Ignored file patterns:"), m_ignorePatterns);
+ layout->addRow(Tr::tr("Custom arguments:"), m_customArguments);
+ layout->addRow(Tr::tr("Ignored file patterns:"), m_ignorePatterns);
auto flags = new Utils::FlowLayout;
layout->addRow(flags);
flags->addWidget(m_inconclusive);
@@ -123,7 +124,7 @@ CppcheckOptionsPage::CppcheckOptionsPage(CppcheckTool &tool, CppcheckTrigger &tr
m_trigger(trigger)
{
setId(Constants::OPTIONS_PAGE_ID);
- setDisplayName(tr("Cppcheck"));
+ setDisplayName(Tr::tr("Cppcheck"));
setCategory("T.Analyzer");
setDisplayCategory(QCoreApplication::translate("Analyzer", "Analyzer"));
setCategoryIconPath(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);
@@ -225,5 +226,4 @@ void CppcheckOptionsPage::load(CppcheckOptions &options) const
s->endGroup();
}
-} // namespace Internal
-} // namespace Cppcheck
+} // Cppcheck::Internal