Better icon downloading.

This commit is contained in:
Martin Rotter 2016-08-29 07:36:34 +02:00
parent 3e1d3583f4
commit 4dd815749e
3 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@ Added:
▪ RSS Guard now can be compiled WITHOUT QtWebEngine module. Minimal Qt required was also lowered to 5.6.0.
Changed:
▪ Obtaining feed metadata including icons is now improved a bit.
▪ Big application core refactoring. Many functions rewritten, some bad code removed.
Fixed:

View File

@ -132,7 +132,7 @@ QNetworkReply::NetworkError NetworkFactory::downloadIcon(const QList<QString> &u
QNetworkReply::NetworkError network_result = QNetworkReply::UnknownNetworkError;
foreach (const QString &url, urls) {
const QString google_s2_with_url = QString("http://www.google.com/s2/favicons?domain=%1").arg(url.toHtmlEscaped());
const QString google_s2_with_url = QString("http://www.google.com/s2/favicons?domain=%1").arg(QUrl(url).host());
QByteArray icon_data;
network_result = performNetworkOperation(google_s2_with_url, timeout, QByteArray(), QString(), icon_data,
QNetworkAccessManager::GetOperation).first;

View File

@ -222,7 +222,7 @@ QPair<StandardFeed*,QNetworkReply::NetworkError> StandardFeed::guessFeed(const Q
password);
result.second = network_result.first;
if (result.second == QNetworkReply::NoError) {
if (result.second == QNetworkReply::NoError || !feed_contents.isEmpty()) {
// Feed XML was obtained, now we need to try to guess
// its encoding before we can read further data.
QString xml_schema_encoding;