|
|
@ -117,15 +117,22 @@ TrackersFilterWidget::~TrackersFilterWidget() |
|
|
|
void TrackersFilterWidget::addTrackers(const BitTorrent::Torrent *torrent, const QVector<BitTorrent::TrackerEntry> &trackers) |
|
|
|
void TrackersFilterWidget::addTrackers(const BitTorrent::Torrent *torrent, const QVector<BitTorrent::TrackerEntry> &trackers) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const BitTorrent::TorrentID torrentID = torrent->id(); |
|
|
|
const BitTorrent::TorrentID torrentID = torrent->id(); |
|
|
|
|
|
|
|
|
|
|
|
for (const BitTorrent::TrackerEntry &tracker : trackers) |
|
|
|
for (const BitTorrent::TrackerEntry &tracker : trackers) |
|
|
|
addItems(tracker.url, {torrentID}); |
|
|
|
addItems(tracker.url, {torrentID}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
removeItem(NULL_HOST, torrentID); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TrackersFilterWidget::removeTrackers(const BitTorrent::Torrent *torrent, const QStringList &trackers) |
|
|
|
void TrackersFilterWidget::removeTrackers(const BitTorrent::Torrent *torrent, const QStringList &trackers) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const BitTorrent::TorrentID torrentID = torrent->id(); |
|
|
|
const BitTorrent::TorrentID torrentID = torrent->id(); |
|
|
|
|
|
|
|
|
|
|
|
for (const QString &tracker : trackers) |
|
|
|
for (const QString &tracker : trackers) |
|
|
|
removeItem(tracker, torrentID); |
|
|
|
removeItem(tracker, torrentID); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (torrent->trackers().isEmpty()) |
|
|
|
|
|
|
|
addItems(NULL_HOST, {torrentID}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TrackersFilterWidget::refreshTrackers(const BitTorrent::Torrent *torrent) |
|
|
|
void TrackersFilterWidget::refreshTrackers(const BitTorrent::Torrent *torrent) |
|
|
@ -167,15 +174,15 @@ void TrackersFilterWidget::refreshTrackers(const BitTorrent::Torrent *torrent) |
|
|
|
addItems(trackerEntry.url, {torrentID}); |
|
|
|
addItems(trackerEntry.url, {torrentID}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
updateGeometry(); |
|
|
|
item(ERROR_ROW)->setText(tr("Error (%1)").arg(m_errors.size())); |
|
|
|
} |
|
|
|
item(WARNING_ROW)->setText(tr("Warning (%1)").arg(m_warnings.size())); |
|
|
|
|
|
|
|
|
|
|
|
void TrackersFilterWidget::changeTrackerless(const BitTorrent::Torrent *torrent, const bool trackerless) |
|
|
|
if (currentRow() == ERROR_ROW) |
|
|
|
{ |
|
|
|
applyFilter(ERROR_ROW); |
|
|
|
if (trackerless) |
|
|
|
else if (currentRow() == WARNING_ROW) |
|
|
|
addItems(NULL_HOST, {torrent->id()}); |
|
|
|
applyFilter(WARNING_ROW); |
|
|
|
else |
|
|
|
|
|
|
|
removeItem(NULL_HOST, torrent->id()); |
|
|
|
updateGeometry(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TrackersFilterWidget::addItems(const QString &trackerURL, const QVector<BitTorrent::TorrentID> &torrents) |
|
|
|
void TrackersFilterWidget::addItems(const QString &trackerURL, const QVector<BitTorrent::TorrentID> &torrents) |
|
|
|