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