mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-04 22:52:33 -06:00
Use QString literals
This patch covers src/gui and some leftovers from previous commit.
This commit is contained in:
@@ -67,9 +67,9 @@ QString PeerAddress::toString() const
|
||||
return {};
|
||||
|
||||
const QString ipStr = (ip.protocol() == QAbstractSocket::IPv6Protocol)
|
||||
? ('[' + ip.toString() + ']')
|
||||
? (u'[' + ip.toString() + u']')
|
||||
: ip.toString();
|
||||
return (ipStr + ':' + QString::number(port));
|
||||
return (ipStr + u':' + QString::number(port));
|
||||
}
|
||||
|
||||
bool BitTorrent::operator==(const BitTorrent::PeerAddress &left, const BitTorrent::PeerAddress &right)
|
||||
|
||||
@@ -214,7 +214,7 @@ QBitArray PeerInfo::pieces() const
|
||||
QString PeerInfo::connectionType() const
|
||||
{
|
||||
if (m_nativeInfo.flags & lt::peer_info::utp_socket)
|
||||
return QString::fromUtf8(C_UTP);
|
||||
return C_UTP;
|
||||
|
||||
return (m_nativeInfo.connection_type == lt::peer_info::standard_bittorrent)
|
||||
? QLatin1String {"BT"}
|
||||
@@ -316,7 +316,7 @@ void PeerInfo::determineFlags()
|
||||
|
||||
// P = Peer is using uTorrent uTP
|
||||
if (useUTPSocket())
|
||||
updateFlags(QLatin1Char('P'), QString::fromUtf8(C_UTP));
|
||||
updateFlags(QLatin1Char('P'), C_UTP);
|
||||
|
||||
m_flags.chop(1);
|
||||
m_flagsDescription.chop(1);
|
||||
|
||||
@@ -5094,7 +5094,7 @@ void Session::handlePeerBlockedAlert(const lt::peer_blocked_alert *p)
|
||||
reason = tr("use of privileged port", "this peer was blocked. Reason: use of privileged port.");
|
||||
break;
|
||||
case lt::peer_blocked_alert::utp_disabled:
|
||||
reason = tr("%1 is disabled", "this peer was blocked. Reason: uTP is disabled.").arg(QString::fromUtf8(C_UTP)); // don't translate μTP
|
||||
reason = tr("%1 is disabled", "this peer was blocked. Reason: uTP is disabled.").arg(C_UTP); // don't translate μTP
|
||||
break;
|
||||
case lt::peer_blocked_alert::tcp_disabled:
|
||||
reason = tr("%1 is disabled", "this peer was blocked. Reason: TCP is disabled.").arg(u"TCP"_qs); // don't translate TCP
|
||||
|
||||
Reference in New Issue
Block a user