Utils: Tr::tr

Change-Id: Ic03e20993f05fb5b49a12c891d86afb2c8e18e08
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2023-01-24 16:49:41 +01:00
parent 17b28909a9
commit 4d6827dde9
65 changed files with 486 additions and 1964 deletions

View File

@@ -1,13 +1,13 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "algorithm.h"
#include "launchersocket.h"
#include "algorithm.h"
#include "launcherinterface.h"
#include "qtcassert.h"
#include "utilstr.h"
#include <QCoreApplication>
#include <QLocalSocket>
#include <QMutexLocker>
@@ -219,8 +219,7 @@ void CallerHandle::start(const QString &program, const QStringList &arguments)
{
QTC_ASSERT(isCalledFromCallersThread(), return);
if (!m_launcherHandle || m_launcherHandle->isSocketError()) {
const QString errorString = QCoreApplication::translate("Utils::LauncherHandle",
"Process launcher socket error.");
const QString errorString = Tr::tr("Process launcher socket error.");
const ProcessResultData result = { 0, QProcess::NormalExit, QProcess::FailedToStart,
errorString };
emit done(result);
@@ -456,8 +455,7 @@ void LauncherHandle::handleSocketError(const QString &message)
return;
// TODO: FailedToStart may be wrong in case process has already started
const QString errorString = QCoreApplication::translate("Utils::QtcProcess",
"Internal socket error: %1").arg(message);
const QString errorString = Tr::tr("Internal socket error: %1").arg(message);
const ProcessResultData result = { 0, QProcess::NormalExit, QProcess::FailedToStart,
errorString };
m_callerHandle->appendSignal(new LauncherDoneSignal(result));
@@ -592,8 +590,7 @@ void LauncherSocket::handleSocketError()
QTC_ASSERT(isCalledFromLaunchersThread(), return);
auto socket = m_socket.load();
if (socket->error() != QLocalSocket::PeerClosedError)
handleError(QCoreApplication::translate("Utils::LauncherSocket",
"Socket error: %1").arg(socket->errorString()));
handleError(Tr::tr("Socket error: %1").arg(socket->errorString()));
}
void LauncherSocket::handleSocketDataAvailable()
@@ -603,8 +600,7 @@ void LauncherSocket::handleSocketDataAvailable()
if (!m_packetParser.parse())
return;
} catch (const PacketParser::InvalidPacketSizeException &e) {
handleError(QCoreApplication::translate("Utils::LauncherSocket",
"Internal protocol error: invalid packet size %1.").arg(e.size));
handleError(Tr::tr("Internal protocol error: invalid packet size %1.").arg(e.size));
return;
}
LauncherHandle *handle = handleForToken(m_packetParser.token());
@@ -617,8 +613,7 @@ void LauncherSocket::handleSocketDataAvailable()
handle->handlePacket(m_packetParser.type(), m_packetParser.packetData());
break;
default:
handleError(QCoreApplication::translate("Utils::LauncherSocket",
"Internal protocol error: invalid packet type %1.")
handleError(Tr::tr("Internal protocol error: invalid packet type %1.")
.arg(static_cast<int>(m_packetParser.type())));
return;
}
@@ -632,8 +627,7 @@ void LauncherSocket::handleSocketDataAvailable()
void LauncherSocket::handleSocketDisconnected()
{
QTC_ASSERT(isCalledFromLaunchersThread(), return);
handleError(QCoreApplication::translate("Utils::LauncherSocket",
"Launcher socket closed unexpectedly."));
handleError(Tr::tr("Launcher socket closed unexpectedly."));
}
void LauncherSocket::handleError(const QString &error)