mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-19 18:26:34 +01:00
WebView: Always update site icon, even when icon is null
This commit is contained in:
parent
e052bda768
commit
58d895e272
@ -33,13 +33,9 @@ IconLoader::IconLoader(const QUrl &url, QObject *parent)
|
||||
|
||||
void IconLoader::finished()
|
||||
{
|
||||
if (m_reply->error() != QNetworkReply::NoError) {
|
||||
emit error();
|
||||
}
|
||||
else {
|
||||
const QByteArray data = m_reply->readAll();
|
||||
emit iconLoaded(QIcon(QPixmap::fromImage(QImage::fromData(data))));
|
||||
}
|
||||
// Ignore error and always emit iconLoaded, even when icon is null
|
||||
const QByteArray data = m_reply->readAll();
|
||||
emit iconLoaded(QIcon(QPixmap::fromImage(QImage::fromData(data))));
|
||||
|
||||
delete m_reply;
|
||||
m_reply = Q_NULLPTR;
|
||||
|
@ -35,7 +35,6 @@ public:
|
||||
|
||||
signals:
|
||||
void iconLoaded(const QIcon &icon);
|
||||
void error();
|
||||
|
||||
private slots:
|
||||
void finished();
|
||||
|
@ -394,12 +394,8 @@ void WebView::slotIconUrlChanged(const QUrl &url)
|
||||
m_siteIconLoader = new IconLoader(url, this);
|
||||
|
||||
connect(m_siteIconLoader, &IconLoader::iconLoaded, [this, url](const QIcon &icon) {
|
||||
if (icon.isNull())
|
||||
return;
|
||||
|
||||
m_siteIcon = icon;
|
||||
emit iconChanged();
|
||||
|
||||
IconProvider::instance()->saveIcon(this);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user