Git: Convert to Tr::tr

Change-Id: I7fb1753109a9263c70c01713f5f4895db6b73662
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Alessandro Portale
2022-10-06 14:05:43 +02:00
committed by hjk
parent b8efc2f14d
commit 928a7d2087
62 changed files with 776 additions and 4045 deletions

View File

@@ -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