better icon downloading of feeds for greader plugin
This commit is contained in:
parent
68e2200e58
commit
70c3f9ed88
@ -30,7 +30,7 @@
|
||||
<url type="donation">https://martinrotter.github.io/donate/</url>
|
||||
<content_rating type="oars-1.1" />
|
||||
<releases>
|
||||
<release version="3.9.0" date="2021-04-14"/>
|
||||
<release version="3.9.0" date="2021-04-15"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.0">
|
||||
<content_attribute id="violence-cartoon">none</content_attribute>
|
||||
|
@ -300,23 +300,26 @@ RootItem* GreaderNetwork::decodeTagsSubscriptions(const QString& categories, con
|
||||
feed->setCustomId(id);
|
||||
|
||||
if (obtain_icons) {
|
||||
QString icon_url = subscription.contains(QSL("iconUrl"))
|
||||
? subscription["iconUrl"].toString()
|
||||
: subscription["htmlUrl"].toString();
|
||||
QString icon_url = subscription["iconUrl"].toString();
|
||||
QList<QPair<QString, bool>> icon_urls;
|
||||
|
||||
icon_urls.append({ url, false });
|
||||
|
||||
if (!icon_url.isEmpty()) {
|
||||
if (icon_url.startsWith(QSL("//"))) {
|
||||
icon_url = QUrl(baseUrl()).scheme() + QSL(":") + icon_url;
|
||||
}
|
||||
|
||||
QIcon icon;
|
||||
icon_urls.append({ icon_url, true });
|
||||
}
|
||||
|
||||
if (NetworkFactory::downloadIcon({ { icon_url, true } },
|
||||
timeout,
|
||||
icon,
|
||||
proxy) == QNetworkReply::NetworkError::NoError) {
|
||||
feed->setIcon(icon);
|
||||
}
|
||||
QIcon icon;
|
||||
|
||||
if (NetworkFactory::downloadIcon(icon_urls,
|
||||
timeout,
|
||||
icon,
|
||||
proxy) == QNetworkReply::NetworkError::NoError) {
|
||||
feed->setIcon(icon);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user