1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Fix saving new icons in database

Regression from 38bf9d2b4a
This commit is contained in:
David Rosca 2016-12-20 12:33:43 +01:00
parent c7fa3101db
commit 3a9e0501df
3 changed files with 18 additions and 3 deletions

View File

@ -44,10 +44,18 @@ void IconProvider::saveIcon(WebView* view)
return;
}
static const char *ignoredSchemes[] = { "qupzilla", "ftp", "file", "view-source" };
for (unsigned i = 0; i < sizeof(ignoredSchemes) / sizeof(ignoredSchemes[0]); ++i)
if (view->url().scheme() == ignoredSchemes[i])
const QStringList ignoredSchemes = {
QStringLiteral("qupzilla"),
QStringLiteral("ftp"),
QStringLiteral("file"),
QStringLiteral("view-source")
};
for (const QString &scheme : ignoredSchemes) {
if (view->url().scheme() == scheme) {
return;
}
}
BufferedIcon item;
item.first = view->url();

View File

@ -58,6 +58,7 @@ WebView::WebView(QWidget* parent)
connect(this, &QWebEngineView::loadStarted, this, &WebView::slotLoadStarted);
connect(this, &QWebEngineView::loadProgress, this, &WebView::slotLoadProgress);
connect(this, &QWebEngineView::loadFinished, this, &WebView::slotLoadFinished);
connect(this, &QWebEngineView::iconChanged, this, &WebView::slotIconChanged);
connect(this, &QWebEngineView::urlChanged, this, &WebView::slotUrlChanged);
m_currentZoomLevel = zoomLevels().indexOf(100);
@ -384,6 +385,11 @@ void WebView::slotLoadFinished(bool ok)
mApp->history()->addHistoryEntry(this);
}
void WebView::slotIconChanged()
{
IconProvider::instance()->saveIcon(this);
}
void WebView::slotUrlChanged(const QUrl &url)
{
Q_UNUSED(url)

View File

@ -112,6 +112,7 @@ protected slots:
void slotLoadStarted();
void slotLoadProgress(int progress);
void slotLoadFinished(bool ok);
void slotIconChanged();
void slotUrlChanged(const QUrl &url);
// Context menu slots