mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Move error logging of adding peers to the proper place
This commit is contained in:
@@ -30,7 +30,9 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
BitTorrent::PeerAddress BitTorrent::PeerAddress::parse(const QString &address)
|
||||
using namespace BitTorrent;
|
||||
|
||||
PeerAddress PeerAddress::parse(const QString &address)
|
||||
{
|
||||
QVector<QStringRef> ipPort;
|
||||
|
||||
@@ -55,3 +57,14 @@ BitTorrent::PeerAddress BitTorrent::PeerAddress::parse(const QString &address)
|
||||
|
||||
return {ip, port};
|
||||
}
|
||||
|
||||
QString PeerAddress::toString() const
|
||||
{
|
||||
if (ip.isNull())
|
||||
return {};
|
||||
|
||||
const QString ipStr = (ip.protocol() == QAbstractSocket::IPv6Protocol)
|
||||
? ('[' + ip.toString() + ']')
|
||||
: ip.toString();
|
||||
return (ipStr + ':' + QString::number(port));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user