mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-22 01:06:03 +03:00
Remove trackers from previous category when moved to new one
PR #21717. Closes #21637.
This commit is contained in:
parent
7b0b3a1522
commit
08b51fc869
1 changed files with 13 additions and 5 deletions
|
@ -394,15 +394,11 @@ void TrackersFilterWidget::handleTrackerStatusesUpdated(const BitTorrent::Torren
|
||||||
{
|
{
|
||||||
if (trackerEntryStatus.state == BitTorrent::TrackerEndpointState::Working)
|
if (trackerEntryStatus.state == BitTorrent::TrackerEndpointState::Working)
|
||||||
{
|
{
|
||||||
|
// remove tracker from "error" and "tracker error" categories
|
||||||
if (errorHashesIt != m_errors.end())
|
if (errorHashesIt != m_errors.end())
|
||||||
{
|
|
||||||
errorHashesIt->remove(trackerEntryStatus.url);
|
errorHashesIt->remove(trackerEntryStatus.url);
|
||||||
}
|
|
||||||
|
|
||||||
if (trackerErrorHashesIt != m_trackerErrors.end())
|
if (trackerErrorHashesIt != m_trackerErrors.end())
|
||||||
{
|
|
||||||
trackerErrorHashesIt->remove(trackerEntryStatus.url);
|
trackerErrorHashesIt->remove(trackerEntryStatus.url);
|
||||||
}
|
|
||||||
|
|
||||||
const bool hasNoWarningMessages = std::all_of(trackerEntryStatus.endpoints.cbegin(), trackerEntryStatus.endpoints.cend()
|
const bool hasNoWarningMessages = std::all_of(trackerEntryStatus.endpoints.cbegin(), trackerEntryStatus.endpoints.cend()
|
||||||
, [](const BitTorrent::TrackerEndpointStatus &endpointEntry)
|
, [](const BitTorrent::TrackerEndpointStatus &endpointEntry)
|
||||||
|
@ -426,12 +422,24 @@ void TrackersFilterWidget::handleTrackerStatusesUpdated(const BitTorrent::Torren
|
||||||
else if ((trackerEntryStatus.state == BitTorrent::TrackerEndpointState::NotWorking)
|
else if ((trackerEntryStatus.state == BitTorrent::TrackerEndpointState::NotWorking)
|
||||||
|| (trackerEntryStatus.state == BitTorrent::TrackerEndpointState::Unreachable))
|
|| (trackerEntryStatus.state == BitTorrent::TrackerEndpointState::Unreachable))
|
||||||
{
|
{
|
||||||
|
// remove tracker from "tracker error" and "warning" categories
|
||||||
|
if (warningHashesIt != m_warnings.end())
|
||||||
|
warningHashesIt->remove(trackerEntryStatus.url);
|
||||||
|
if (trackerErrorHashesIt != m_trackerErrors.end())
|
||||||
|
trackerErrorHashesIt->remove(trackerEntryStatus.url);
|
||||||
|
|
||||||
if (errorHashesIt == m_errors.end())
|
if (errorHashesIt == m_errors.end())
|
||||||
errorHashesIt = m_errors.insert(id, {});
|
errorHashesIt = m_errors.insert(id, {});
|
||||||
errorHashesIt->insert(trackerEntryStatus.url);
|
errorHashesIt->insert(trackerEntryStatus.url);
|
||||||
}
|
}
|
||||||
else if (trackerEntryStatus.state == BitTorrent::TrackerEndpointState::TrackerError)
|
else if (trackerEntryStatus.state == BitTorrent::TrackerEndpointState::TrackerError)
|
||||||
{
|
{
|
||||||
|
// remove tracker from "error" and "warning" categories
|
||||||
|
if (warningHashesIt != m_warnings.end())
|
||||||
|
warningHashesIt->remove(trackerEntryStatus.url);
|
||||||
|
if (errorHashesIt != m_errors.end())
|
||||||
|
errorHashesIt->remove(trackerEntryStatus.url);
|
||||||
|
|
||||||
if (trackerErrorHashesIt == m_trackerErrors.end())
|
if (trackerErrorHashesIt == m_trackerErrors.end())
|
||||||
trackerErrorHashesIt = m_trackerErrors.insert(id, {});
|
trackerErrorHashesIt = m_trackerErrors.insert(id, {});
|
||||||
trackerErrorHashesIt->insert(trackerEntryStatus.url);
|
trackerErrorHashesIt->insert(trackerEntryStatus.url);
|
||||||
|
|
Loading…
Reference in a new issue