Fix lupdate issues

Some tr functions missing, some places where we need full qualification
because lupdate gets confused with namespaces.

Change-Id: Ic1d6ef3b31960dda02bc0788a255857117acdca9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Eike Ziller
2021-07-09 14:51:22 +02:00
parent c916bcd049
commit e895a0380b
14 changed files with 73 additions and 35 deletions

View File

@@ -34,6 +34,8 @@ namespace Internal {
class BazaarSettings final : public VcsBase::VcsBaseSettings
{
Q_DECLARE_TR_FUNCTIONS(Bazaar::Internal::BazaarSettings)
public:
BazaarSettings();

View File

@@ -72,7 +72,7 @@ CMakeSpecificSettings::CMakeSpecificSettings()
CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *settings)
{
setId("CMakeSpecificSettings");
setDisplayName(CMakeSpecificSettings::tr("CMake"));
setDisplayName(::CMakeProjectManager::Internal::CMakeSpecificSettings::tr("CMake"));
setCategory(ProjectExplorer::Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
setSettings(settings);
@@ -81,7 +81,7 @@ CMakeSpecificSettingsPage::CMakeSpecificSettingsPage(CMakeSpecificSettings *sett
using namespace Layouting;
Column {
Group {
Title(CMakeSpecificSettings::tr("Adding Files")),
Title(::CMakeProjectManager::Internal::CMakeSpecificSettings::tr("Adding Files")),
s.afterAddFileSetting
},
s.packageManagerAutoSetup,

View File

@@ -64,7 +64,7 @@ FileShareProtocolSettingsPage::FileShareProtocolSettingsPage(FileShareProtocolSe
setLayouter([&s = *settings](QWidget *widget) {
using namespace Layouting;
auto label = new QLabel(FileShareProtocolSettingsPage::tr(
auto label = new QLabel(FileShareProtocolSettings::tr(
"The fileshare-based paster protocol allows for sharing code snippets using "
"simple files on a shared network drive. Files are never deleted."));
label->setWordWrap(true);

View File

@@ -48,6 +48,8 @@ const char DEFAULT_DOCKER_COMMAND[] = "run --read-only --rm %{BuildDevice:Docker
class DockerBuildStep : public AbstractProcessStep
{
Q_DECLARE_TR_FUNCTIONS(Docker::Internal::DockerBuildStep)
public:
DockerBuildStep(BuildStepList *bsl, Id id)
: AbstractProcessStep(bsl, id)

View File

@@ -1203,7 +1203,7 @@ public:
DockerDeviceSetupWizard()
: QDialog(ICore::dialogParent())
{
setWindowTitle(tr("Docker Image Selection"));
setWindowTitle(DockerDevice::tr("Docker Image Selection"));
resize(800, 600);
m_model.setHeader({"Image", "Repository", "Tag", "Size"});
@@ -1232,7 +1232,7 @@ public:
m_buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
CommandLine cmd{"docker", {"images", "--format", "{{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.Size}}"}};
m_log->append(tr("Running \"%1\"\n").arg(cmd.toUserOutput()));
m_log->append(DockerDevice::tr("Running \"%1\"\n").arg(cmd.toUserOutput()));
m_process = new QtcProcess(this);
m_process->setCommand(cmd);
@@ -1243,7 +1243,7 @@ public:
for (const QString &line : out.split('\n')) {
const QStringList parts = line.trimmed().split('\t');
if (parts.size() != 4) {
m_log->append(tr("Unexpected result: %1").arg(line) + '\n');
m_log->append(DockerDevice::tr("Unexpected result: %1").arg(line) + '\n');
continue;
}
auto item = new DockerImageItem;
@@ -1253,12 +1253,12 @@ public:
item->size = parts.at(3);
m_model.rootItem()->appendChild(item);
}
m_log->append(tr("Done."));
m_log->append(DockerDevice::tr("Done."));
});
connect(m_process, &Utils::QtcProcess::readyReadStandardError, this, [this] {
const QString out = tr("Error: %1").arg(m_process->stdErr());
m_log->append(tr("Error: %1").arg(out));
const QString out = DockerDevice::tr("Error: %1").arg(m_process->stdErr());
m_log->append(DockerDevice::tr("Error: %1").arg(out));
});
connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged, [this] {

View File

@@ -35,6 +35,8 @@ namespace Internal {
class DockerSettings : public Utils::AspectContainer
{
Q_DECLARE_TR_FUNCTIONS(Docker::Internal::DockerSettings)
public:
DockerSettings();
static DockerSettings *instance();

View File

@@ -34,6 +34,8 @@ namespace Internal {
class MercurialSettings : public VcsBase::VcsBaseSettings
{
Q_DECLARE_TR_FUNCTIONS(Mercurial::Internal::MercurialSettings)
public:
Utils::StringAspect diffIgnoreWhiteSpace;
Utils::StringAspect diffIgnoreBlankLines;

View File

@@ -254,7 +254,8 @@ PerforceSettingsPage::PerforceSettingsPage(PerforceSettings *settings)
connect(checker, &PerforceChecker::succeeded, errorLabel,
[errorLabel, testButton, checker](const QString &repo) {
errorLabel->setStyleSheet({});
errorLabel->setText(tr("Test succeeded (%1).").arg(QDir::toNativeSeparators(repo)));
errorLabel->setText(PerforceSettings::tr("Test succeeded (%1).")
.arg(QDir::toNativeSeparators(repo)));
testButton->setEnabled(true);
checker->deleteLater();
});

View File

@@ -121,7 +121,7 @@ BuildSystemOutputWindow::BuildSystemOutputWindow()
m_filterActionRegexp = new QAction(this);
m_filterActionRegexp->setCheckable(true);
m_filterActionRegexp->setText(tr("Use Regular Expressions"));
m_filterActionRegexp->setText(ProjectWindow::tr("Use Regular Expressions"));
connect(m_filterActionRegexp, &QAction::toggled, this, &BuildSystemOutputWindow::updateFilter);
Core::ActionManager::registerAction(m_filterActionRegexp,
kRegExpActionId,
@@ -129,7 +129,7 @@ BuildSystemOutputWindow::BuildSystemOutputWindow()
m_filterActionCaseSensitive = new QAction(this);
m_filterActionCaseSensitive->setCheckable(true);
m_filterActionCaseSensitive->setText(tr("Case Sensitive"));
m_filterActionCaseSensitive->setText(ProjectWindow::tr("Case Sensitive"));
connect(m_filterActionCaseSensitive,
&QAction::toggled,
this,
@@ -140,7 +140,7 @@ BuildSystemOutputWindow::BuildSystemOutputWindow()
m_invertFilterAction = new QAction(this);
m_invertFilterAction->setCheckable(true);
m_invertFilterAction->setText(tr("Show Non-matching Lines"));
m_invertFilterAction->setText(ProjectWindow::tr("Show Non-matching Lines"));
connect(m_invertFilterAction, &QAction::toggled, this, &BuildSystemOutputWindow::updateFilter);
Core::ActionManager::registerAction(m_invertFilterAction,
kInvertActionId,

View File

@@ -100,7 +100,8 @@ void MetaInfoReader::elementStart(const QString &name)
case ParsingHints:
case Finished:
case Undefined: setParserState(Error);
addError(tr("Illegal state while parsing."), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Illegal state while parsing."),
currentSourceLocation());
case Error:
default: return;
}
@@ -120,7 +121,8 @@ void MetaInfoReader::elementEnd()
case ParsingDocument:
case Finished:
case Undefined: setParserState(Error);
addError(tr("Illegal state while parsing."), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Illegal state while parsing."),
currentSourceLocation());
case Error:
default: return;
}
@@ -135,12 +137,16 @@ void MetaInfoReader::propertyDefinition(const QString &name, const QVariant &val
case ParsingProperty: readPropertyProperty(name, value); break;
case ParsingQmlSource: readQmlSourceProperty(name, value); break;
case ParsingExtraFile: readExtraFileProperty(name, value); break;
case ParsingMetaInfo: addError(tr("No property definition allowed."), currentSourceLocation()); break;
case ParsingMetaInfo:
addError(::QmlDesigner::Internal::MetaInfoReader::tr("No property definition allowed."),
currentSourceLocation());
break;
case ParsingDocument:
case ParsingHints: readHint(name, value); break;
case Finished:
case Undefined: setParserState(Error);
addError(tr("Illegal state while parsing."), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Illegal state while parsing."),
currentSourceLocation());
case Error:
default: return;
}
@@ -203,26 +209,30 @@ MetaInfoReader::ParserSate MetaInfoReader::readItemLibraryEntryElement(const QSt
} else if (name == ExtraFileElementName) {
return ParsingExtraFile;
} else {
addError(tr("Invalid type %1").arg(name), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name),
currentSourceLocation());
return Error;
}
}
MetaInfoReader::ParserSate MetaInfoReader::readPropertyElement(const QString &name)
{
addError(tr("Invalid type %1").arg(name), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name),
currentSourceLocation());
return Error;
}
MetaInfoReader::ParserSate MetaInfoReader::readQmlSourceElement(const QString &name)
{
addError(tr("Invalid type %1").arg(name), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name),
currentSourceLocation());
return Error;
}
MetaInfoReader::ParserSate MetaInfoReader::readExtraFileElement(const QString &name)
{
addError(tr("Invalid type %1").arg(name), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(name),
currentSourceLocation());
return Error;
}
@@ -237,7 +247,9 @@ void MetaInfoReader::readImportsProperty(const QString &name, const QVariant &va
// imports to keep compatibility with old metainfo files.
m_metaInfo.itemLibraryInfo()->addPriorityImports(Utils::toSet(values));
} else {
addError(tr("Unknown property for Imports %1").arg(name), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for Imports %1")
.arg(name),
currentSourceLocation());
setParserState(Error);
}
}
@@ -251,7 +263,9 @@ void MetaInfoReader::readTypeProperty(const QString &name, const QVariant &value
} else if (name == QStringLiteral("icon")) {
m_currentIcon = absoluteFilePathForDocument(value.toString());
} else {
addError(tr("Unknown property for Type %1").arg(name), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for Type %1")
.arg(name),
currentSourceLocation());
setParserState(Error);
}
}
@@ -269,7 +283,10 @@ void MetaInfoReader::readItemLibraryEntryProperty(const QString &name, const QVa
} else if (name == QStringLiteral("requiredImport")) {
m_currentEntry.setRequiredImport(value.toString());
} else {
addError(tr("Unknown property for ItemLibraryEntry %1").arg(name), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr(
"Unknown property for ItemLibraryEntry %1")
.arg(name),
currentSourceLocation());
setParserState(Error);
}
}
@@ -299,7 +316,9 @@ void MetaInfoReader::readPropertyProperty(const QString &name, const QVariant &v
} else if (name == QStringLiteral("value")) {
m_currentPropertyValue = deEscapeVariant(value);
} else {
addError(tr("Unknown property for Property %1").arg(name), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for Property %1")
.arg(name),
currentSourceLocation());
setParserState(Error);
}
}
@@ -309,7 +328,9 @@ void MetaInfoReader::readQmlSourceProperty(const QString &name, const QVariant &
if (name == QLatin1String("source")) {
m_currentEntry.setQmlPath(absoluteFilePathForDocument(value.toString()));
} else {
addError(tr("Unknown property for QmlSource %1").arg(name), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for QmlSource %1")
.arg(name),
currentSourceLocation());
setParserState(Error);
}
}
@@ -319,7 +340,9 @@ void MetaInfoReader::readExtraFileProperty(const QString &name, const QVariant &
if (name == QLatin1String("source")) {
m_currentEntry.addExtraFilePath(absoluteFilePathForDocument(value.toString()));
} else {
addError(tr("Unknown property for ExtraFile %1").arg(name), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Unknown property for ExtraFile %1")
.arg(name),
currentSourceLocation());
setParserState(Error);
}
}
@@ -366,7 +389,10 @@ void MetaInfoReader::syncItemLibraryEntries()
try {
m_metaInfo.itemLibraryInfo()->addEntries(m_bufferedEntries, m_overwriteDuplicates);
} catch (const InvalidMetaInfoException &) {
addError(tr("Invalid or duplicate library entry %1").arg(m_currentEntry.name()), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr(
"Invalid or duplicate library entry %1")
.arg(m_currentEntry.name()),
currentSourceLocation());
}
m_bufferedEntries.clear();
}
@@ -383,7 +409,8 @@ void MetaInfoReader::insertProperty()
void MetaInfoReader::addErrorInvalidType(const QString &typeName)
{
addError(tr("Invalid type %1").arg(typeName), currentSourceLocation());
addError(::QmlDesigner::Internal::MetaInfoReader::tr("Invalid type %1").arg(typeName),
currentSourceLocation());
}
QString MetaInfoReader::absoluteFilePathForDocument(const QString &relativeFilePath)

View File

@@ -407,7 +407,7 @@ void SubComponentManager::parseQuick3DAssetsItem(const QString &importUrl, const
ItemLibraryEntry itemLibraryEntry;
itemLibraryEntry.setType(type.toUtf8(), 1, 0);
itemLibraryEntry.setName(name);
itemLibraryEntry.setCategory(tr("My 3D Components"));
itemLibraryEntry.setCategory(::QmlDesigner::SubComponentManager::tr("My 3D Components"));
itemLibraryEntry.setRequiredImport(importUrl);
QString iconPath = qmlIt.fileInfo().absolutePath() + '/'
+ Constants::QUICK_3D_ASSET_ICON_DIR + '/' + name

View File

@@ -70,9 +70,9 @@ QString DocumentMessage::toString() const
QString str;
if (m_type == ParseError)
str += tr("Error parsing");
str += ::QmlDesigner::DocumentMessage::tr("Error parsing");
else if (m_type == InternalError)
str += tr("Internal error");
str += ::QmlDesigner::DocumentMessage::tr("Internal error");
if (url().isValid()) {
if (!str.isEmpty())
@@ -84,14 +84,14 @@ QString DocumentMessage::toString() const
if (line() != -1) {
if (!str.isEmpty())
str += QLatin1Char(' ');
str += tr("line %1").arg(line());
str += ::QmlDesigner::DocumentMessage::tr("line %1").arg(line());
}
if (column() != -1) {
if (!str.isEmpty())
str += QLatin1Char(' ');
str += tr("column %1").arg(column());
str += ::QmlDesigner::DocumentMessage::tr("column %1").arg(column());
}
if (!str.isEmpty())

View File

@@ -26,7 +26,7 @@
#include "remotelinuxkillappservice.h"
#include <utils/fileutils.h>
#
namespace RemoteLinux {
namespace Internal {
class RemoteLinuxKillAppServicePrivate

View File

@@ -40,6 +40,8 @@ class SuppressionAspectPrivate;
class SuppressionAspect final : public Utils::BaseAspect
{
Q_DECLARE_TR_FUNCTIONS(Valgrind::Internal::SuppressionAspect)
public:
explicit SuppressionAspect(bool global);
~SuppressionAspect() final;