1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-08 22:07:53 +00:00

Merge pull request #9187 from glassez/tracker-favicon

Download favicon using appropriate protocol
This commit is contained in:
Vladimir Golovnev 2018-07-14 12:01:58 +03:00 committed by GitHub
commit c7f1f1494e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,7 +246,8 @@ void TrackerFiltersList::addItem(const QString &tracker, const QString &hash)
trackerItem = new QListWidgetItem();
trackerItem->setData(Qt::DecorationRole, GuiIconProvider::instance()->getIcon("network-server"));
downloadFavicon(QString("%1://%2/favicon.ico").arg(getScheme(tracker), host));
const QString scheme = getScheme(tracker);
downloadFavicon(QString("%1://%2/favicon.ico").arg((scheme.startsWith("http") ? scheme : "http"), host));
}
if (!trackerItem) return;
@ -332,8 +333,11 @@ void TrackerFiltersList::setDownloadTrackerFavicon(bool value)
if (m_downloadTrackerFavicon) {
for (auto i = m_trackers.cbegin(); i != m_trackers.cend(); ++i) {
const QString &tracker = i.key();
if (!tracker.isEmpty())
downloadFavicon(QString("http://%1/favicon.ico").arg(tracker));
if (!tracker.isEmpty()) {
const QString scheme = getScheme(tracker);
downloadFavicon(QString("%1://%2/favicon.ico")
.arg((scheme.startsWith("http") ? scheme : "http"), getHost(tracker)));
}
}
}
}