summaryrefslogtreecommitdiff
path: root/src/plugins/git/gitgrep.cpp
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2022-10-06 14:05:43 +0200
committerhjk <hjk@qt.io>2022-10-06 12:32:58 +0000
commit928a7d2087406abef2b076705ba4aa51b8ef3c92 (patch)
treedcceff7a811fde4771966d874b14764e611ba7a0 /src/plugins/git/gitgrep.cpp
parentb8efc2f14de4859409fef57f58e2b813e72bc510 (diff)
downloadqt-creator-928a7d2087406abef2b076705ba4aa51b8ef3c92.tar.gz
Git: Convert to Tr::tr
Change-Id: I7fb1753109a9263c70c01713f5f4895db6b73662 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/plugins/git/gitgrep.cpp')
-rw-r--r--src/plugins/git/gitgrep.cpp34
1 files changed, 15 insertions, 19 deletions
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 <coreplugin/vcsmanager.h>
@@ -25,8 +27,13 @@
#include <QSettings>
#include <QTextStream>
-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<FileSearchResultList>;
@@ -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<QHBoxLayout>(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)