mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +08:00
Improve compatibility with libtorrent 2.0
In libtorrent 2.0, the `connection_type` was changed to a flag type and hence it cannot be used in a switch statement directly. Also our use of `connection_type` is limited so that a single equality comparison would cover all of our use cases.
This commit is contained in:
parent
172eda5471
commit
c95e450b8d
@ -220,17 +220,9 @@ QString PeerInfo::connectionType() const
|
||||
if (m_nativeInfo.flags & lt::peer_info::utp_socket)
|
||||
return QString::fromUtf8(C_UTP);
|
||||
|
||||
QString connection;
|
||||
switch (m_nativeInfo.connection_type) {
|
||||
case lt::peer_info::http_seed:
|
||||
case lt::peer_info::web_seed:
|
||||
connection = "Web";
|
||||
break;
|
||||
default:
|
||||
connection = "BT";
|
||||
}
|
||||
|
||||
return connection;
|
||||
return (m_nativeInfo.connection_type == lt::peer_info::standard_bittorrent)
|
||||
? QLatin1String {"BT"}
|
||||
: QLatin1String {"Web"};
|
||||
}
|
||||
|
||||
void PeerInfo::calcRelevance(const TorrentHandle *torrent)
|
||||
|
Loading…
Reference in New Issue
Block a user