Favicon stuff

This commit is contained in:
Fredrik Johansson
2018-12-29 11:40:46 +01:00
committed by wmayer
parent f6643bd19c
commit a4e549b7f2
2 changed files with 10 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ public:
{
if (info.navigationType() == QWebEngineUrlRequestInfo::NavigationTypeLink) {
// invoke thread safe.
QMetaObject::invokeMethod(m_parent, "onLinkClicked",
QMetaObject::invokeMethod(m_parent, "urlFilter",
Q_ARG(QUrl, info.requestUrl()));
}
@@ -346,6 +346,9 @@ BrowserView::BrowserView(QWidget* parent)
interceptLinks = new WebEngineUrlRequestInterceptor(this);
profile->setRequestInterceptor(interceptLinks);
view->settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, true);
#endif
view->setAttribute(Qt::WA_OpaquePaintEvent, true);
@@ -386,7 +389,11 @@ BrowserView::~BrowserView()
delete view;
}
#ifdef QTWEBENGINE
void BrowserView::urlFilter(const QUrl &url)
#else
void BrowserView::onLinkClicked (const QUrl & url)
#endif
{
QString scheme = url.scheme();
QString host = url.host();

View File

@@ -108,15 +108,16 @@ protected Q_SLOTS:
void onLoadStarted();
void onLoadProgress(int);
void onLoadFinished(bool);
void onLinkClicked (const QUrl& url);
bool chckHostAllowed(const QString& host);
#ifdef QTWEBENGINE
void onDownloadRequested(QWebEngineDownloadItem *request);
void setWindowIcon(const QIcon &icon);
void urlFilter(const QUrl &url);
void onViewSource(const QUrl &url);
#else
void onDownloadRequested(const QNetworkRequest& request);
void onUnsupportedContent(QNetworkReply* reply);
void onLinkClicked (const QUrl& url);
#endif
void onOpenLinkInExternalBrowser(const QUrl& url);
void onOpenLinkInNewWindow(const QUrl&);