forked from qt-creator/qt-creator
CppCheck: Tr::tr and code cosmetics
Change-Id: I5e6583984f7dc94e998df3c20840f2ba2e801ab8 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user