summaryrefslogtreecommitdiff
path: root/src/plugins/cppcheck/cppcheckplugin.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/cppcheckplugin.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/cppcheckplugin.cpp')
-rw-r--r--src/plugins/cppcheck/cppcheckplugin.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/plugins/cppcheck/cppcheckplugin.cpp b/src/plugins/cppcheck/cppcheckplugin.cpp
index 76c88b8116..33afa6c43d 100644
--- a/src/plugins/cppcheck/cppcheckplugin.cpp
+++ b/src/plugins/cppcheck/cppcheckplugin.cpp
@@ -2,10 +2,12 @@
// 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 "cppchecktextmarkmanager.h"
#include "cppchecktool.h"
+#include "cppchecktr.h"
#include "cppchecktrigger.h"
#include "cppcheckdiagnosticsmodel.h"
#include "cppcheckmanualrundialog.h"
@@ -26,32 +28,28 @@
#include <utils/qtcassert.h>
#include <utils/utilsicons.h>
-namespace Cppcheck {
-namespace Internal {
+namespace Cppcheck::Internal {
class CppcheckPluginPrivate final : public QObject
{
public:
explicit CppcheckPluginPrivate();
+
CppcheckTextMarkManager marks;
- CppcheckTool tool;
- CppcheckTrigger trigger;
- CppcheckOptionsPage options;
+ CppcheckTool tool{marks, Constants::CHECK_PROGRESS_ID};
+ CppcheckTrigger trigger{marks, tool};
+ CppcheckOptionsPage options{tool, trigger};
DiagnosticsModel manualRunModel;
- CppcheckTool manualRunTool;
- Utils::Perspective perspective{Constants::PERSPECTIVE_ID,
- ::Cppcheck::Internal::CppcheckPlugin::tr("Cppcheck")};
+ CppcheckTool manualRunTool{manualRunModel, Constants::MANUAL_CHECK_PROGRESS_ID};
+ Utils::Perspective perspective{Constants::PERSPECTIVE_ID, ::Cppcheck::Tr::tr("Cppcheck")};
+
QAction *manualRunAction;
void startManualRun();
void updateManualRunAction();
};
-CppcheckPluginPrivate::CppcheckPluginPrivate() :
- tool(marks, Constants::CHECK_PROGRESS_ID),
- trigger(marks, tool),
- options(tool, trigger),
- manualRunTool(manualRunModel, Constants::MANUAL_CHECK_PROGRESS_ID)
+CppcheckPluginPrivate::CppcheckPluginPrivate()
{
manualRunTool.updateOptions(tool.options());
@@ -64,7 +62,7 @@ CppcheckPluginPrivate::CppcheckPluginPrivate() :
auto action = new QAction(this);
action->setEnabled(false);
action->setIcon(Utils::Icons::PREV_TOOLBAR.icon());
- action->setToolTip(CppcheckPlugin::tr("Go to previous diagnostic."));
+ action->setToolTip(Tr::tr("Go to previous diagnostic."));
connect(action, &QAction::triggered,
manualRunView, &Debugger::DetailedErrorView::goBack);
connect (&manualRunModel, &DiagnosticsModel::hasDataChanged,
@@ -77,7 +75,7 @@ CppcheckPluginPrivate::CppcheckPluginPrivate() :
auto action = new QAction(this);
action->setEnabled(false);
action->setIcon(Utils::Icons::NEXT_TOOLBAR.icon());
- action->setToolTip(CppcheckPlugin::tr("Go to next diagnostic."));
+ action->setToolTip(Tr::tr("Go to next diagnostic."));
connect(action, &QAction::triggered,
manualRunView, &Debugger::DetailedErrorView::goNext);
connect (&manualRunModel, &DiagnosticsModel::hasDataChanged,
@@ -90,7 +88,7 @@ CppcheckPluginPrivate::CppcheckPluginPrivate() :
auto action = new QAction(this);
action->setEnabled(false);
action->setIcon(Utils::Icons::CLEAN_TOOLBAR.icon());
- action->setToolTip(CppcheckPlugin::tr("Clear"));
+ action->setToolTip(Tr::tr("Clear"));
connect(action, &QAction::triggered,
&manualRunModel, &DiagnosticsModel::clear);
connect (&manualRunModel, &DiagnosticsModel::hasDataChanged,
@@ -146,7 +144,7 @@ bool CppcheckPlugin::initialize(const QStringList &arguments, QString *errorStri
ActionContainer *menu = ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER);
{
- auto action = new QAction(tr("Cppcheck..."), this);
+ auto action = new QAction(Tr::tr("Cppcheck..."), this);
menu->addAction(ActionManager::registerAction(action, Constants::MANUAL_RUN_ACTION),
Debugger::Constants::G_ANALYZER_TOOLS);
connect(action, &QAction::triggered,
@@ -162,5 +160,4 @@ bool CppcheckPlugin::initialize(const QStringList &arguments, QString *errorStri
return true;
}
-} // namespace Internal
-} // namespace Cppcheck
+} // Cppcheck::Internal