1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +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; return;
} }
static const char *ignoredSchemes[] = { "qupzilla", "ftp", "file", "view-source" }; const QStringList ignoredSchemes = {
for (unsigned i = 0; i < sizeof(ignoredSchemes) / sizeof(ignoredSchemes[0]); ++i) QStringLiteral("qupzilla"),
if (view->url().scheme() == ignoredSchemes[i]) QStringLiteral("ftp"),
QStringLiteral("file"),
QStringLiteral("view-source")
};
for (const QString &scheme : ignoredSchemes) {
if (view->url().scheme() == scheme) {
return; return;
}
}
BufferedIcon item; BufferedIcon item;
item.first = view->url(); item.first = view->url();

View File

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

View File

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