|
|
|
@ -440,6 +440,7 @@ int CategoryFiltersList::rowFromCategory(const QString &category) const
@@ -440,6 +440,7 @@ int CategoryFiltersList::rowFromCategory(const QString &category) const
|
|
|
|
|
TrackerFiltersList::TrackerFiltersList(QWidget *parent, TransferListWidget *transferList) |
|
|
|
|
: FiltersBase(parent, transferList) |
|
|
|
|
, m_totalTorrents(0) |
|
|
|
|
, m_downloadTrackerFavicon(true) |
|
|
|
|
{ |
|
|
|
|
QListWidgetItem *allTrackers = new QListWidgetItem(this); |
|
|
|
|
allTrackers->setData(Qt::DisplayRole, QVariant(tr("All (0)", "this is for the tracker filter"))); |
|
|
|
@ -566,6 +567,19 @@ void TrackerFiltersList::changeTrackerless(bool trackerless, const QString &hash
@@ -566,6 +567,19 @@ void TrackerFiltersList::changeTrackerless(bool trackerless, const QString &hash
|
|
|
|
|
removeItem("", hash); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TrackerFiltersList::setDownloadTrackerFavicon(bool value) |
|
|
|
|
{ |
|
|
|
|
if (value == m_downloadTrackerFavicon) return; |
|
|
|
|
m_downloadTrackerFavicon = value; |
|
|
|
|
|
|
|
|
|
if (m_downloadTrackerFavicon) { |
|
|
|
|
foreach (const QString &tracker, m_trackers.keys()) { |
|
|
|
|
if (!tracker.isEmpty()) |
|
|
|
|
downloadFavicon(QString("http://%1/favicon.ico").arg(tracker)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TrackerFiltersList::trackerSuccess(const QString &hash, const QString &tracker) |
|
|
|
|
{ |
|
|
|
|
QStringList errored = m_errors.value(hash); |
|
|
|
@ -630,6 +644,7 @@ void TrackerFiltersList::trackerWarning(const QString &hash, const QString &trac
@@ -630,6 +644,7 @@ void TrackerFiltersList::trackerWarning(const QString &hash, const QString &trac
|
|
|
|
|
|
|
|
|
|
void TrackerFiltersList::downloadFavicon(const QString& url) |
|
|
|
|
{ |
|
|
|
|
if (!m_downloadTrackerFavicon) return; |
|
|
|
|
Net::DownloadHandler *h = Net::DownloadManager::instance()->downloadUrl(url, true); |
|
|
|
|
connect(h, SIGNAL(downloadFinished(QString, QString)), this, SLOT(handleFavicoDownload(QString, QString))); |
|
|
|
|
connect(h, SIGNAL(downloadFailed(QString, QString)), this, SLOT(handleFavicoFailure(QString, QString))); |
|
|
|
@ -835,6 +850,11 @@ TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferLi
@@ -835,6 +850,11 @@ TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferLi
|
|
|
|
|
connect(this, SIGNAL(trackerWarning(const QString &, const QString &)), trackerFilters, SLOT(trackerWarning(const QString &, const QString &))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TransferListFiltersWidget::setDownloadTrackerFavicon(bool value) |
|
|
|
|
{ |
|
|
|
|
trackerFilters->setDownloadTrackerFavicon(value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TransferListFiltersWidget::addTrackers(BitTorrent::TorrentHandle *const torrent, const QList<BitTorrent::TrackerEntry> &trackers) |
|
|
|
|
{ |
|
|
|
|
foreach (const BitTorrent::TrackerEntry &tracker, trackers) |
|
|
|
|