From 2c9b2c35356caf4fd8213cff7e599a7c49346ac2 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 22 Jun 2018 10:53:47 +0200 Subject: Fix various warnings --- src/webengine/webpage.cpp | 7 ++++--- src/webengine/webpage.h | 2 ++ src/webengine/webview.cpp | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/webengine/webpage.cpp b/src/webengine/webpage.cpp index 6fba97c..7358223 100644 --- a/src/webengine/webpage.cpp +++ b/src/webengine/webpage.cpp @@ -32,6 +32,7 @@ QString feature_toString(QWebEnginePage::Feature feature) case QWebEnginePage::DesktopAudioVideoCapture: return QObject::tr("Desktop Audio and Video Capture"); } + return QString(); } WebPage::WebPage(QWebEngineProfile *profile, QObject *parent) @@ -72,13 +73,13 @@ bool WebPage::certificateError(const QWebEngineCertificateError &certificateErro return resp == QMessageBox::Ignore; } +#ifdef QTBUG_68224_WORKAROUND bool WebPage::acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) { - /* Workaround for https://bugreports.qt.io/browse/QTBUG-68224 * Only affects 5.11.0; should be fixed in 5.11.1 */ -#ifdef QTBUG_68224_WORKAROUND + auto *layout = this->view()->layout(); auto count = layout->count(); @@ -94,10 +95,10 @@ bool WebPage::acceptNavigationRequest(const QUrl &url, NavigationType type, bool } } } -#endif return true; } +#endif void WebPage::featurePermissionDialog(const QUrl &securityOrigin, QWebEnginePage::Feature feature) { diff --git a/src/webengine/webpage.h b/src/webengine/webpage.h index 2232d26..3e5ce34 100644 --- a/src/webengine/webpage.h +++ b/src/webengine/webpage.h @@ -19,7 +19,9 @@ public: protected: bool certificateError(const QWebEngineCertificateError &certificateError) override; +#ifdef QTBUG_68224_WORKAROUND bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame) override; +#endif private slots: void featurePermissionDialog(const QUrl &securityOrigin, QWebEnginePage::Feature feature); diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp index c6fd4a4..f1b52b7 100644 --- a/src/webengine/webview.cpp +++ b/src/webengine/webview.cpp @@ -106,6 +106,7 @@ void WebView::triggerViewAction(WebView::ViewAction action) switch(action) { case GoHome: load(m_profile->homepage()); + break; case BookmarkPage: emit newBookmark(this->title(), this->url()); break; -- cgit v1.2.1