|
|
@ -651,14 +651,8 @@ void TrackerFiltersList::handleFavicoDownload(const QString& url, const QString& |
|
|
|
QList<QSize> sizes = icon.availableSizes(); |
|
|
|
QList<QSize> sizes = icon.availableSizes(); |
|
|
|
bool invalid = (sizes.isEmpty() || icon.pixmap(sizes.first()).isNull()); |
|
|
|
bool invalid = (sizes.isEmpty() || icon.pixmap(sizes.first()).isNull()); |
|
|
|
if (invalid) { |
|
|
|
if (invalid) { |
|
|
|
if (url.endsWith(".ico", Qt::CaseInsensitive)) { |
|
|
|
if (url.endsWith(".ico", Qt::CaseInsensitive)) |
|
|
|
Logger::instance()->addMessage(tr("Couldn't decode favicon for URL '%1'. Trying to download favicon in PNG format.").arg(url), |
|
|
|
|
|
|
|
Log::WARNING); |
|
|
|
|
|
|
|
downloadFavicon(url.left(url.size() - 4) + ".png"); |
|
|
|
downloadFavicon(url.left(url.size() - 4) + ".png"); |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
Logger::instance()->addMessage(tr("Couldn't decode favicon for URL '%1'.").arg(url), Log::WARNING); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Utils::Fs::forceRemove(filePath); |
|
|
|
Utils::Fs::forceRemove(filePath); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
else { |
|
|
@ -669,10 +663,7 @@ void TrackerFiltersList::handleFavicoDownload(const QString& url, const QString& |
|
|
|
|
|
|
|
|
|
|
|
void TrackerFiltersList::handleFavicoFailure(const QString& url, const QString& error) |
|
|
|
void TrackerFiltersList::handleFavicoFailure(const QString& url, const QString& error) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Don't use getHost() on the url here. Print the full url. The error might relate to
|
|
|
|
Q_UNUSED(error) |
|
|
|
// that.
|
|
|
|
|
|
|
|
Logger::instance()->addMessage(tr("Couldn't download favicon for URL '%1'. Reason: %2").arg(url).arg(error), |
|
|
|
|
|
|
|
Log::WARNING); |
|
|
|
|
|
|
|
if (url.endsWith(".ico", Qt::CaseInsensitive)) |
|
|
|
if (url.endsWith(".ico", Qt::CaseInsensitive)) |
|
|
|
downloadFavicon(url.left(url.size() - 4) + ".png"); |
|
|
|
downloadFavicon(url.left(url.size() - 4) + ".png"); |
|
|
|
} |
|
|
|
} |
|
|
|