mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-24 21:44:25 +00:00
- Another compilation fix for libtorrent v0.14
This commit is contained in:
parent
c1d3f719df
commit
5544f2a138
@ -560,7 +560,24 @@ void QTorrentHandle::set_peer_download_limit(asio::ip::tcp::endpoint ip, int lim
|
|||||||
|
|
||||||
void QTorrentHandle::add_tracker(announce_entry const& url) {
|
void QTorrentHandle::add_tracker(announce_entry const& url) {
|
||||||
Q_ASSERT(h.is_valid());
|
Q_ASSERT(h.is_valid());
|
||||||
|
#ifdef LIBTORRENT_0_15
|
||||||
h.add_tracker(url);
|
h.add_tracker(url);
|
||||||
|
#else
|
||||||
|
std::vector<announce_entry> trackers = h.trackers();
|
||||||
|
bool exists = false;
|
||||||
|
std::vector<announce_entry>::iterator it = trackers.begin();
|
||||||
|
while(it != trackers.end()) {
|
||||||
|
if(it->url == url.url) {
|
||||||
|
exists = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
if(!exists) {
|
||||||
|
trackers.push_back(url);
|
||||||
|
h.replace_trackers(trackers);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QTorrentHandle::prioritize_first_last_piece(bool b) {
|
void QTorrentHandle::prioritize_first_last_piece(bool b) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user