mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Improve tracker entries handling
PR #19468. * Use QHash to map tracker endpoints * Don't clear numPeers unexpectedly * Remove outdated tracker entry endpoints * Move presentation logic from Core to GUI code * Show all endpoints per tracker in tree structure --------- Co-authored-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
parent
34d30ed031
commit
c805606524
8 changed files with 176 additions and 91 deletions
|
@ -5920,7 +5920,7 @@ void SessionImpl::handleTrackerAlert(const lt::tracker_alert *a)
|
|||
if (!torrent)
|
||||
return;
|
||||
|
||||
QMap<TrackerEntry::Endpoint, int> &updateInfo = m_updatedTrackerEntries[torrent->nativeHandle()][std::string(a->tracker_url())];
|
||||
QHash<TrackerEntry::Endpoint, int> &updateInfo = m_updatedTrackerEntries[torrent->nativeHandle()][std::string(a->tracker_url())];
|
||||
|
||||
if (a->type() == lt::tracker_reply_alert::alert_type)
|
||||
{
|
||||
|
@ -6004,7 +6004,7 @@ void SessionImpl::processTrackerStatuses()
|
|||
if (updatedTrackersIter == updatedTrackers.end())
|
||||
continue;
|
||||
|
||||
const QMap<TrackerEntry::Endpoint, int> &updateInfo = updatedTrackersIter.value();
|
||||
const QHash<TrackerEntry::Endpoint, int> &updateInfo = updatedTrackersIter.value();
|
||||
TrackerEntry trackerEntry = torrent->updateTrackerEntry(announceEntry, updateInfo);
|
||||
const QString url = trackerEntry.url;
|
||||
updatedTrackerEntries.emplace(url, std::move(trackerEntry));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue