summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2022-06-24 13:19:04 +0200
committerEike Ziller <eike.ziller@qt.io>2022-06-27 07:05:22 +0000
commit92c74abbf1c56cc7d9b78534a0513166c1888272 (patch)
tree5fbdb5f8d60ba083d03a8000fed8d691d3def4b2 /src
parent67f98c0c83a2b51f958723aaed0372831473b1ae (diff)
downloadqt-creator-92c74abbf1c56cc7d9b78534a0513166c1888272.tar.gz
Fix lupdate issues
Change-Id: I7256c8aff5eb77b264b76ba24e79c26ab2924e84 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/libs/utils/qtcprocess.cpp10
-rw-r--r--src/libs/utils/terminalprocess.cpp54
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeprocess.cpp33
-rw-r--r--src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp3
-rw-r--r--src/plugins/cppcheck/cppchecktextmark.cpp2
-rw-r--r--src/plugins/gitlab/gitlaboptionspage.cpp10
-rw-r--r--src/plugins/python/pysidebuildconfiguration.cpp2
-rw-r--r--src/plugins/python/pythonsettings.cpp8
-rw-r--r--src/plugins/remotelinux/linuxdevice.cpp10
-rw-r--r--src/plugins/studiowelcome/presetmodel.cpp4
10 files changed, 79 insertions, 57 deletions
diff --git a/src/libs/utils/qtcprocess.cpp b/src/libs/utils/qtcprocess.cpp
index b05e6bc5fe..a4c427db05 100644
--- a/src/libs/utils/qtcprocess.cpp
+++ b/src/libs/utils/qtcprocess.cpp
@@ -285,8 +285,10 @@ bool DefaultImpl::dissolveCommand(QString *program, QStringList *arguments)
*arguments = QStringList();
} else {
if (!success) {
- const ProcessResultData result = { 0, QProcess::NormalExit, QProcess::FailedToStart,
- tr("Error in command line.") };
+ const ProcessResultData result = {0,
+ QProcess::NormalExit,
+ QProcess::FailedToStart,
+ QtcProcess::tr("Error in command line.")};
emit done(result);
return false;
}
@@ -314,8 +316,8 @@ bool DefaultImpl::ensureProgramExists(const QString &program)
if (programFilePath.exists() && programFilePath.isExecutableFile())
return true;
- const QString errorString = tr("The program \"%1\" does not exist or is not executable.")
- .arg(program);
+ const QString errorString
+ = QtcProcess::tr("The program \"%1\" does not exist or is not executable.").arg(program);
const ProcessResultData result = { 0, QProcess::NormalExit, QProcess::FailedToStart,
errorString };
emit done(result);
diff --git a/src/libs/utils/terminalprocess.cpp b/src/libs/utils/terminalprocess.cpp
index a623191524..556ae5dc3c 100644
--- a/src/libs/utils/terminalprocess.cpp
+++ b/src/libs/utils/terminalprocess.cpp
@@ -79,43 +79,44 @@ static QString modeOption(TerminalMode m)
static QString msgCommChannelFailed(const QString &error)
{
- return TerminalImpl::tr("Cannot set up communication channel: %1").arg(error);
+ return QtcProcess::tr("Cannot set up communication channel: %1").arg(error);
}
static QString msgPromptToClose()
{
// Shown in a terminal which might have a different character set on Windows.
- return TerminalImpl::tr("Press <RETURN> to close this window...");
+ return QtcProcess::tr("Press <RETURN> to close this window...");
}
static QString msgCannotCreateTempFile(const QString &why)
{
- return TerminalImpl::tr("Cannot create temporary file: %1").arg(why);
+ return QtcProcess::tr("Cannot create temporary file: %1").arg(why);
}
static QString msgCannotWriteTempFile()
{
- return TerminalImpl::tr("Cannot write temporary file. Disk full?");
+ return QtcProcess::tr("Cannot write temporary file. Disk full?");
}
static QString msgCannotCreateTempDir(const QString & dir, const QString &why)
{
- return TerminalImpl::tr("Cannot create temporary directory \"%1\": %2").arg(dir, why);
+ return QtcProcess::tr("Cannot create temporary directory \"%1\": %2").arg(dir, why);
}
static QString msgUnexpectedOutput(const QByteArray &what)
{
- return TerminalImpl::tr("Unexpected output from helper program (%1).").arg(QString::fromLatin1(what));
+ return QtcProcess::tr("Unexpected output from helper program (%1).")
+ .arg(QString::fromLatin1(what));
}
static QString msgCannotChangeToWorkDir(const FilePath &dir, const QString &why)
{
- return TerminalImpl::tr("Cannot change to working directory \"%1\": %2").arg(dir.toString(), why);
+ return QtcProcess::tr("Cannot change to working directory \"%1\": %2").arg(dir.toString(), why);
}
static QString msgCannotExecute(const QString & p, const QString &why)
{
- return TerminalImpl::tr("Cannot execute \"%1\": %2").arg(p, why);
+ return QtcProcess::tr("Cannot execute \"%1\": %2").arg(p, why);
}
class TerminalProcessPrivate
@@ -310,8 +311,8 @@ void TerminalImpl::start()
if (!success) {
delete d->m_pid;
d->m_pid = nullptr;
- const QString msg = tr("The process \"%1\" could not be started: %2")
- .arg(cmdLine, winErrorMessage(GetLastError()));
+ const QString msg = QtcProcess::tr("The process \"%1\" could not be started: %2")
+ .arg(cmdLine, winErrorMessage(GetLastError()));
cleanupAfterStartFailure(msg);
return;
}
@@ -335,13 +336,14 @@ void TerminalImpl::start()
pcmd = m_setup.m_commandLine.executable().toString();
} else {
if (perr != ProcessArgs::FoundMeta) {
- emitError(QProcess::FailedToStart, tr("Quoting error in command."));
+ emitError(QProcess::FailedToStart, QtcProcess::tr("Quoting error in command."));
return;
}
if (m_setup.m_terminalMode == TerminalMode::Debug) {
// FIXME: QTCREATORBUG-2809
- emitError(QProcess::FailedToStart, tr("Debugging complex shell commands in a terminal"
- " is currently not supported."));
+ emitError(QProcess::FailedToStart,
+ QtcProcess::tr("Debugging complex shell commands in a terminal"
+ " is currently not supported."));
return;
}
pcmd = qEnvironmentVariable("SHELL", "/bin/sh");
@@ -358,9 +360,10 @@ void TerminalImpl::start()
&m_setup.m_environment,
&m_setup.m_workingDirectory);
if (qerr != ProcessArgs::SplitOk) {
- emitError(QProcess::FailedToStart, qerr == ProcessArgs::BadQuoting
- ? tr("Quoting error in terminal command.")
- : tr("Terminal command may not be a shell command."));
+ emitError(QProcess::FailedToStart,
+ qerr == ProcessArgs::BadQuoting
+ ? QtcProcess::tr("Quoting error in terminal command.")
+ : QtcProcess::tr("Terminal command may not be a shell command."));
return;
}
@@ -414,8 +417,10 @@ void TerminalImpl::start()
d->m_process.setReaperTimeout(m_setup.m_reaperTimeout);
d->m_process.start();
if (!d->m_process.waitForStarted()) {
- const QString msg = tr("Cannot start the terminal emulator \"%1\", change the setting in the "
- "Environment options.").arg(terminal.command);
+ const QString msg
+ = QtcProcess::tr("Cannot start the terminal emulator \"%1\", change the setting in the "
+ "Environment options.")
+ .arg(terminal.command);
cleanupAfterStartFailure(msg);
return;
}
@@ -542,7 +547,8 @@ QString TerminalImpl::stubServerListen()
const QString stubServer = stubFifoDir + QLatin1String("/stub-socket");
if (!d->m_stubServer.listen(stubServer)) {
::rmdir(d->m_stubServerDir.constData());
- return tr("Cannot create socket \"%1\": %2").arg(stubServer, d->m_stubServer.errorString());
+ return QtcProcess::tr("Cannot create socket \"%1\": %2")
+ .arg(stubServer, d->m_stubServer.errorString());
}
return QString();
#endif
@@ -613,8 +619,9 @@ void TerminalImpl::readStubOutput()
SYNCHRONIZE | PROCESS_QUERY_INFORMATION | PROCESS_TERMINATE,
FALSE, d->m_processId);
if (d->m_hInferior == NULL) {
- emitError(QProcess::FailedToStart, tr("Cannot obtain a handle to the inferior: %1")
- .arg(winErrorMessage(GetLastError())));
+ emitError(QProcess::FailedToStart,
+ QtcProcess::tr("Cannot obtain a handle to the inferior: %1")
+ .arg(winErrorMessage(GetLastError())));
// Uhm, and now what?
continue;
}
@@ -623,8 +630,9 @@ void TerminalImpl::readStubOutput()
DWORD chldStatus;
if (!GetExitCodeProcess(d->m_hInferior, &chldStatus))
- emitError(QProcess::UnknownError, tr("Cannot obtain exit status from inferior: %1")
- .arg(winErrorMessage(GetLastError())));
+ emitError(QProcess::UnknownError,
+ QtcProcess::tr("Cannot obtain exit status from inferior: %1")
+ .arg(winErrorMessage(GetLastError())));
cleanupInferior();
emitFinished(chldStatus, QProcess::NormalExit);
});
diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp
index 2bcbbf8882..8ffe635419 100644
--- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp
@@ -81,8 +81,9 @@ void CMakeProcess::run(const BuildDirParameters &parameters, const QStringList &
const FilePath buildDirectory = parameters.buildDirectory.onDevice(cmakeExecutable);
if (!buildDirectory.exists()) {
- QString msg = tr("The build directory \"%1\" does not exist")
- .arg(buildDirectory.toUserOutput());
+ QString msg = ::CMakeProjectManager::Internal::CMakeProcess::tr(
+ "The build directory \"%1\" does not exist")
+ .arg(buildDirectory.toUserOutput());
BuildSystem::appendBuildSystemOutput(msg + '\n');
emit finished();
return;
@@ -90,9 +91,11 @@ void CMakeProcess::run(const BuildDirParameters &parameters, const QStringList &
if (buildDirectory.needsDevice()) {
if (cmake->cmakeExecutable().host() != buildDirectory.host()) {
- QString msg = tr("CMake executable \"%1\" and build directory "
- "\"%2\" must be on the same device.")
- .arg(cmake->cmakeExecutable().toUserOutput(), buildDirectory.toUserOutput());
+ QString msg = ::CMakeProjectManager::Internal::CMakeProcess::tr(
+ "CMake executable \"%1\" and build directory "
+ "\"%2\" must be on the same device.")
+ .arg(cmake->cmakeExecutable().toUserOutput(),
+ buildDirectory.toUserOutput());
BuildSystem::appendBuildSystemOutput(msg + '\n');
emit finished();
return;
@@ -131,12 +134,15 @@ void CMakeProcess::run(const BuildDirParameters &parameters, const QStringList &
TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);
BuildSystem::startNewBuildSystemOutput(
- tr("Running %1 in %2.").arg(commandLine.toUserOutput(), buildDirectory.toUserOutput()));
+ ::CMakeProjectManager::Internal::CMakeProcess::tr("Running %1 in %2.")
+ .arg(commandLine.toUserOutput(), buildDirectory.toUserOutput()));
m_futureInterface = QFutureInterface<void>();
m_futureInterface.setProgressRange(0, 1);
Core::ProgressManager::addTimedTask(m_futureInterface,
- tr("Configuring \"%1\"").arg(parameters.projectName),
+ ::CMakeProjectManager::Internal::CMakeProcess::tr(
+ "Configuring \"%1\"")
+ .arg(parameters.projectName),
"CMake.Configure",
10);
m_futureWatcher.reset(new QFutureWatcher<void>);
@@ -167,14 +173,17 @@ void CMakeProcess::handleProcessDone(const Utils::ProcessResultData &resultData)
QString msg;
if (resultData.m_error == QProcess::FailedToStart) {
- msg = tr("CMake process failed to start.");
+ msg = ::CMakeProjectManager::Internal::CMakeProcess::tr("CMake process failed to start.");
} else if (resultData.m_exitStatus != QProcess::NormalExit) {
if (m_futureInterface.isCanceled() || code == USER_STOP_EXIT_CODE)
- msg = tr("CMake process was canceled by the user.");
- else
- msg = tr("CMake process crashed.");
+ msg = ::CMakeProjectManager::Internal::CMakeProcess::tr(
+ "CMake process was canceled by the user.");
+ else
+ msg = ::CMakeProjectManager::Internal::CMakeProcess::tr("CMake process crashed.");
} else if (code != 0) {
- msg = tr("CMake process exited with exit code %1.").arg(code);
+ msg = ::CMakeProjectManager::Internal::CMakeProcess::tr(
+ "CMake process exited with exit code %1.")
+ .arg(code);
}
m_lastExitCode = code;
diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp
index 8c5af3b140..fb17b33657 100644
--- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp
+++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp
@@ -109,7 +109,8 @@ static std::vector<std::unique_ptr<CMakeTool>> autoDetectCMakeTools()
for (const FilePath &command : qAsConst(suspects)) {
auto item = std::make_unique<CMakeTool>(CMakeTool::AutoDetection, CMakeTool::createId());
item->setFilePath(command);
- item->setDisplayName(CMakeToolManager::tr("System CMake at %1").arg(command.toUserOutput()));
+ item->setDisplayName(::CMakeProjectManager::CMakeToolManager::tr("System CMake at %1")
+ .arg(command.toUserOutput()));
found.emplace_back(std::move(item));
}
diff --git a/src/plugins/cppcheck/cppchecktextmark.cpp b/src/plugins/cppcheck/cppchecktextmark.cpp
index d4882e7f05..d3446a0610 100644
--- a/src/plugins/cppcheck/cppchecktextmark.cpp
+++ b/src/plugins/cppcheck/cppchecktextmark.cpp
@@ -84,7 +84,7 @@ CppcheckTextMark::CppcheckTextMark (const Diagnostic &diagnostic)
// Copy to clipboard action
QAction *action = new QAction();
action->setIcon(QIcon::fromTheme("edit-copy", Utils::Icons::COPY.icon()));
- action->setToolTip(tr("Copy to Clipboard"));
+ action->setToolTip(TextMark::tr("Copy to Clipboard"));
QObject::connect(action, &QAction::triggered, [diagnostic]() {
const QString text = QString("%1:%2: %3")
.arg(diagnostic.fileName.toUserOutput())
diff --git a/src/plugins/gitlab/gitlaboptionspage.cpp b/src/plugins/gitlab/gitlaboptionspage.cpp
index d533b985f8..5687eb9ec8 100644
--- a/src/plugins/gitlab/gitlaboptionspage.cpp
+++ b/src/plugins/gitlab/gitlaboptionspage.cpp
@@ -64,27 +64,27 @@ GitLabServerWidget::GitLabServerWidget(Mode m, QWidget *parent)
: QWidget(parent)
, m_mode(m)
{
- m_host.setLabelText(tr("Host:"));
+ m_host.setLabelText(GitLabOptionsPage::tr("Host:"));
m_host.setDisplayStyle(m == Display ? Utils::StringAspect::LabelDisplay
: Utils::StringAspect::LineEditDisplay);
m_host.setValidationFunction([](Utils::FancyLineEdit *l, QString *) {
return hostValid(l->text());
});
- m_description.setLabelText(tr("Description:"));
+ m_description.setLabelText(GitLabOptionsPage::tr("Description:"));
m_description.setDisplayStyle(m == Display ? Utils::StringAspect::LabelDisplay
: Utils::StringAspect::LineEditDisplay);
- m_token.setLabelText(tr("Access token:"));
+ m_token.setLabelText(GitLabOptionsPage::tr("Access token:"));
m_token.setDisplayStyle(m == Display ? Utils::StringAspect::LabelDisplay
: Utils::StringAspect::LineEditDisplay);
m_token.setVisible(m == Edit);
m_port.setRange(1, 65535);
m_port.setValue(GitLabServer::defaultPort);
- auto portLabel = new QLabel(tr("Port:"), this);
+ auto portLabel = new QLabel(GitLabOptionsPage::tr("Port:"), this);
m_port.setEnabled(m == Edit);
- m_secure.setLabelText(tr("HTTPS:"));
+ m_secure.setLabelText(GitLabOptionsPage::tr("HTTPS:"));
m_secure.setLabelPlacement(Utils::BoolAspect::LabelPlacement::InExtraLabel);
m_secure.setDefaultValue(true);
m_secure.setEnabled(m == Edit);
diff --git a/src/plugins/python/pysidebuildconfiguration.cpp b/src/plugins/python/pysidebuildconfiguration.cpp
index 1df0c4ea67..058b877f57 100644
--- a/src/plugins/python/pysidebuildconfiguration.cpp
+++ b/src/plugins/python/pysidebuildconfiguration.cpp
@@ -105,7 +105,7 @@ void PySideBuildStep::doRun()
PySideBuildConfiguration::PySideBuildConfiguration(Target *target, Id id)
: BuildConfiguration(target, id)
{
- setConfigWidgetDisplayName(tr("General"));
+ setConfigWidgetDisplayName(PySideBuildConfigurationFactory::tr("General"));
setInitializer([this](const BuildInfo &) {
buildSteps()->appendStep(pySideBuildStep);
diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp
index 3e6dbf27d4..c2b183bef8 100644
--- a/src/plugins/python/pythonsettings.cpp
+++ b/src/plugins/python/pythonsettings.cpp
@@ -400,8 +400,8 @@ public:
PyLSConfigureWidget()
: m_editor(LanguageClient::jsonEditor())
, m_advancedLabel(new QLabel)
- , m_pluginsGroup(new QGroupBox(tr("Plugins:")))
- , m_mainGroup(new QGroupBox(tr("Use Python Language Server")))
+ , m_pluginsGroup(new QGroupBox(PythonSettings::tr("Plugins:")))
+ , m_mainGroup(new QGroupBox(PythonSettings::tr("Use Python Language Server")))
{
m_mainGroup->setCheckable(true);
@@ -422,7 +422,7 @@ public:
mainGroupLayout->addWidget(m_pluginsGroup);
- const QString labelText = tr(
+ const QString labelText = PythonSettings::tr(
"For a complete list of avilable options, consult the <a "
"href=\"https://github.com/python-lsp/python-lsp-server/blob/develop/"
"CONFIGURATION.md\">Python LSP Server configuration documentation</a>.");
@@ -436,7 +436,7 @@ public:
mainGroupLayout->addStretch();
- auto advanced = new QCheckBox(tr("Advanced"));
+ auto advanced = new QCheckBox(PythonSettings::tr("Advanced"));
advanced->setChecked(false);
connect(advanced,
diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp
index 74bc231aa0..69910f0131 100644
--- a/src/plugins/remotelinux/linuxdevice.cpp
+++ b/src/plugins/remotelinux/linuxdevice.cpp
@@ -1553,13 +1553,15 @@ private:
{
const FilePath sftpBinary = SshSettings::sftpFilePath();
if (!sftpBinary.exists()) {
- startFailed(tr("\"sftp\" binary \"%1\" does not exist.").arg(sftpBinary.toUserOutput()));
+ startFailed(SshTransferInterface::tr("\"sftp\" binary \"%1\" does not exist.")
+ .arg(sftpBinary.toUserOutput()));
return;
}
m_batchFile.reset(new QTemporaryFile(this));
if (!m_batchFile->isOpen() && !m_batchFile->open()) {
- startFailed(tr("Could not create temporary file: %1").arg(m_batchFile->errorString()));
+ startFailed(SshTransferInterface::tr("Could not create temporary file: %1")
+ .arg(m_batchFile->errorString()));
return;
}
@@ -1570,8 +1572,8 @@ private:
+ '\n');
} else if (direction() == FileTransferDirection::Download) {
if (!QDir::root().mkpath(dir.path())) {
- startFailed(tr("Failed to create local directory \"%1\".")
- .arg(QDir::toNativeSeparators(dir.path())));
+ startFailed(SshTransferInterface::tr("Failed to create local directory \"%1\".")
+ .arg(QDir::toNativeSeparators(dir.path())));
return;
}
}
diff --git a/src/plugins/studiowelcome/presetmodel.cpp b/src/plugins/studiowelcome/presetmodel.cpp
index 6705b6ca65..136a56dd01 100644
--- a/src/plugins/studiowelcome/presetmodel.cpp
+++ b/src/plugins/studiowelcome/presetmodel.cpp
@@ -34,8 +34,8 @@ constexpr int NameRole = Qt::UserRole;
constexpr int ScreenSizeRole = Qt::UserRole + 1;
constexpr int IsUserPresetRole = Qt::UserRole + 2;
-static const QString RecentsTabName = QObject::tr("Recents");
-static const QString CustomTabName = QObject::tr("Custom");
+static const QString RecentsTabName = ::StudioWelcome::PresetModel::tr("Recents");
+static const QString CustomTabName = ::StudioWelcome::PresetModel::tr("Custom");
/****************** PresetData ******************/