mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 05:51:23 +08:00
When calling arg() on a QString constructed from a literal, use QStringLiteral.
This commit is contained in:
@@ -30,8 +30,7 @@ namespace BlackMisc
|
||||
QString CRawFsdMessage::convertToQString(bool i18n) const
|
||||
{
|
||||
Q_UNUSED(i18n);
|
||||
static const QString s("%1 %2");
|
||||
return s.arg(this->getFormattedUtcTimestampHmsz(), m_rawMessage);
|
||||
return QStringLiteral("%1 %2").arg(this->getFormattedUtcTimestampHmsz(), m_rawMessage);
|
||||
}
|
||||
|
||||
bool CRawFsdMessage::isPacketType(const QString &type) const
|
||||
|
||||
@@ -31,8 +31,7 @@ namespace BlackMisc
|
||||
QString CRemoteFile::getNameAndSize() const
|
||||
{
|
||||
if (!this->hasName()) { return {}; }
|
||||
static const QString s("%1 (%2)");
|
||||
return s.arg(this->getName(), this->getSizeHumanReadable());
|
||||
return QStringLiteral("%1 (%2)").arg(this->getName(), this->getSizeHumanReadable());
|
||||
}
|
||||
|
||||
bool CRemoteFile::matchesName(const QString &name) const
|
||||
|
||||
@@ -57,8 +57,7 @@ namespace BlackMisc
|
||||
|
||||
QString CServer::convertToQString(bool i18n) const
|
||||
{
|
||||
static const QString str("%1 %2 %3:%4 %5 %6 accepting: %7 FSD: %8 con.since: %9");
|
||||
return str.
|
||||
return QStringLiteral("%1 %2 %3:%4 %5 %6 accepting: %7 FSD: %8 con.since: %9").
|
||||
arg(m_name, m_description, m_address).arg(m_port).
|
||||
arg(m_user.toQString(i18n), m_ecosystem.getSystemString(),
|
||||
boolToYesNo(m_isAcceptingConnections), m_fsdSetup.toQString(i18n), this->isConnected() ? this->getFormattedUtcTimestampHms() : "not con.");
|
||||
|
||||
@@ -196,7 +196,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (!msg.isEmpty())
|
||||
{
|
||||
m_errorMsgs.append(QString("URL: %1 error: %2").arg(url.toQString(), msg));
|
||||
m_errorMsgs.append(QStringLiteral("URL: %1 error: %2").arg(url.toQString(), msg));
|
||||
}
|
||||
return obtainNextWorkingUrl(random, connectTimeoutMs);
|
||||
}
|
||||
|
||||
@@ -148,8 +148,7 @@ namespace BlackMisc
|
||||
QString CUrlLogList::getSummary() const
|
||||
{
|
||||
static const QString s("Entries: %1, pending: %2, errors: %3, min: %4ms avg: %5ms max: %6ms");
|
||||
static const QString e("No data");
|
||||
if (this->isEmpty()) return e;
|
||||
if (this->isEmpty()) return QStringLiteral("No data");
|
||||
return s.arg(this->size()).arg(this->sizePending()).arg(this->sizeErrors()).arg(this->getMinResponseTime()).arg(this->getAverageResponseTime()).arg(this->getMaxResponseTime());
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user