summaryrefslogtreecommitdiff
path: root/src/plugins/git/branchmodel.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/branchmodel.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/branchmodel.cpp')
-rw-r--r--src/plugins/git/branchmodel.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp
index b33b4ab277..c262f07c0b 100644
--- a/src/plugins/git/branchmodel.cpp
+++ b/src/plugins/git/branchmodel.cpp
@@ -2,8 +2,10 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#include "branchmodel.h"
+
#include "gitclient.h"
#include "gitconstants.h"
+#include "gittr.h"
#include <vcsbase/vcscommand.h>
#include <vcsbase/vcsoutputwindow.h>
@@ -22,8 +24,7 @@
using namespace Utils;
using namespace VcsBase;
-namespace Git {
-namespace Internal {
+namespace Git::Internal {
enum RootNodes {
LocalBranches = 0,
@@ -254,8 +255,8 @@ BranchModel::BranchModel(GitClient *client, QObject *parent) :
QTC_CHECK(d->client);
// Abuse the sha field for ref prefix
- d->rootNode->append(new BranchNode(tr("Local Branches"), "refs/heads"));
- d->rootNode->append(new BranchNode(tr("Remote Branches"), "refs/remotes"));
+ d->rootNode->append(new BranchNode(Tr::tr("Local Branches"), "refs/heads"));
+ d->rootNode->append(new BranchNode(Tr::tr("Remote Branches"), "refs/remotes"));
connect(&d->fsWatcher, &Utils::FileSystemWatcher::fileChanged, this, [this] {
QString errorMessage;
refresh(d->workingDirectory, &errorMessage);
@@ -440,7 +441,7 @@ bool BranchModel::refresh(const FilePath &workingDirectory, QString *errorMessag
}
if (!d->currentBranch) {
BranchNode *local = d->rootNode->children.at(LocalBranches);
- d->currentBranch = d->headNode = new BranchNode(tr("Detached HEAD"), "HEAD", QString(),
+ d->currentBranch = d->headNode = new BranchNode(Tr::tr("Detached HEAD"), "HEAD", QString(),
d->currentDateTime);
local->prepend(d->headNode);
}
@@ -796,7 +797,7 @@ void BranchModel::Private::parseOutputLine(const QString &line, bool force)
oldEntriesRoot = root->append(new BranchNode(remoteName));
} else if (showTags && nameParts.first() == "tags") {
if (!hasTags()) // Tags is missing, add it
- rootNode->append(new BranchNode(tr("Tags"), "refs/tags"));
+ rootNode->append(new BranchNode(Tr::tr("Tags"), "refs/tags"));
rootType = Tags;
} else {
return;
@@ -925,6 +926,4 @@ QString BranchModel::toolTip(const QString &sha) const
return output;
}
-} // namespace Internal
-} // namespace Git
-
+} // Git::Internal