From 928a7d2087406abef2b076705ba4aa51b8ef3c92 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 6 Oct 2022 14:05:43 +0200 Subject: Git: Convert to Tr::tr Change-Id: I7fb1753109a9263c70c01713f5f4895db6b73662 Reviewed-by: Alessandro Portale --- src/plugins/git/gitgrep.cpp | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'src/plugins/git/gitgrep.cpp') diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index abcea246bf..1e0fc3f131 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -2,7 +2,9 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0 #include "gitgrep.h" + #include "gitclient.h" +#include "gittr.h" #include @@ -25,8 +27,13 @@ #include #include -namespace Git { -namespace Internal { +using namespace Core; +using namespace Utils; +using namespace VcsBase; + +namespace Git::Internal { + +const char GitGrepRef[] = "GitGrepRef"; class GitGrepParameters { @@ -36,14 +43,6 @@ public: QString id() const { return recurseSubmodules ? ref + ".Rec" : ref; } }; -using namespace Core; -using namespace Utils; -using namespace VcsBase; - -namespace { - -const char GitGrepRef[] = "GitGrepRef"; - class GitGrepRunner { using FutureInterfaceType = QFutureInterface; @@ -192,8 +191,6 @@ private: Environment m_environment; }; -} // namespace - static bool isGitDirectory(const FilePath &path) { static IVersionControl *gitVc = VcsManager::versionControl(VcsBase::Constants::VCS_ID_GIT); @@ -208,8 +205,8 @@ GitGrep::GitGrep(GitClient *client) auto layout = new QHBoxLayout(m_widget); layout->setContentsMargins(0, 0, 0, 0); m_treeLineEdit = new FancyLineEdit; - m_treeLineEdit->setPlaceholderText(tr("Tree (optional)")); - m_treeLineEdit->setToolTip(tr("Can be HEAD, tag, local or remote branch, or a commit hash.\n" + m_treeLineEdit->setPlaceholderText(Tr::tr("Tree (optional)")); + m_treeLineEdit->setToolTip(Tr::tr("Can be HEAD, tag, local or remote branch, or a commit hash.\n" "Leave empty to search through the file system.")); const QRegularExpression refExpression("[\\S]*"); m_treeLineEdit->setValidator(new QRegularExpressionValidator(refExpression, this)); @@ -219,7 +216,7 @@ GitGrep::GitGrep(GitClient *client) this, [this, pLayout = QPointer(layout)](unsigned version) { if (version >= 0x021300 && pLayout) { - m_recurseSubmodules = new QCheckBox(tr("Recurse submodules")); + m_recurseSubmodules = new QCheckBox(Tr::tr("Recurse submodules")); pLayout->addWidget(m_recurseSubmodules); } }); @@ -240,14 +237,14 @@ GitGrep::~GitGrep() QString GitGrep::title() const { - return tr("Git Grep"); + return Tr::tr("Git Grep"); } QString GitGrep::toolTip() const { const QString ref = m_treeLineEdit->text(); if (!ref.isEmpty()) - return tr("Ref: %1\n%2").arg(ref); + return Tr::tr("Ref: %1\n%2").arg(ref); return QLatin1String("%1"); } @@ -296,7 +293,6 @@ IEditor *GitGrep::openEditor(const SearchResultItem &item, return editor; } -} // Internal -} // Git +} // Git::Internal Q_DECLARE_METATYPE(Git::Internal::GitGrepParameters) -- cgit v1.2.1