mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
parent
c7fa3101db
commit
3a9e0501df
@ -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();
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user