digikam/Fix-build-with-QtWebEngine-5.6.patch

101 lines
3.6 KiB
Diff

From 27b90c533f99cd4f67f99ef5c506f80db6c012af Mon Sep 17 00:00:00 2001
From: Gilles Caulier <caulier.gilles@gmail.com>
Date: Fri, 19 Apr 2019 14:52:42 +0200
Subject: Apply patch from Wolfgang Bauer to Fix build with QtWebEngine 5.6
Differential Revision: https://phabricator.kde.org/D20681
---
bootstrap.linux | 2 +-
core/app/views/stack/welcomepageview.cpp | 5 +++++
core/libs/dplugins/webservices/webwidget_qwebengine.cpp | 3 +++
.../utilities/geolocation/geoiface/widgets/htmlwidget_qwebengine.cpp | 3 +++
4 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/bootstrap.linux b/bootstrap.linux
index 30677b6..4a3b07c 100755
--- a/bootstrap.linux
+++ b/bootstrap.linux
@@ -87,7 +87,7 @@ $CMAKE_BINARY -G "$MAKEFILES_TYPE" . \
-DENABLE_MEDIAPLAYER=ON \
-DENABLE_DBUS=ON \
-DENABLE_APPSTYLES=ON \
- -DENABLE_QWEBENGINE=OFF \
+ -DENABLE_QWEBENGINE=ON \
-DENABLE_FACESENGINE_DNN=ON \
-Wno-dev \
$SOURCEDIR && echo "$MESSAGE"
diff --git a/core/app/views/stack/welcomepageview.cpp b/core/app/views/stack/welcomepageview.cpp
index 9528933..1491ce7 100644
--- a/core/app/views/stack/welcomepageview.cpp
+++ b/core/app/views/stack/welcomepageview.cpp
@@ -34,6 +34,9 @@
#include <QWidget>
#include <QApplication>
#include <QStandardPaths>
+#ifdef HAVE_QWEBENGINE
+# include <QtWebEngineWidgetsVersion>
+#endif
// KDE includes
@@ -90,8 +93,10 @@ WelcomePageView::WelcomePageView(QWidget* const parent)
setContentsMargins(QMargins());
#ifdef HAVE_QWEBENGINE
+#if QTWEBENGINEWIDGETS_VERSION >= QT_VERSION_CHECK(5, 7, 0)
settings()->setAttribute(QWebEngineSettings::WebGLEnabled, false);
settings()->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, false);
+#endif
WelcomePageViewPage* const wpage = new WelcomePageViewPage(this);
setPage(wpage);
diff --git a/core/libs/dplugins/webservices/webwidget_qwebengine.cpp b/core/libs/dplugins/webservices/webwidget_qwebengine.cpp
index f7f6ed8..e1849b1 100644
--- a/core/libs/dplugins/webservices/webwidget_qwebengine.cpp
+++ b/core/libs/dplugins/webservices/webwidget_qwebengine.cpp
@@ -26,6 +26,7 @@
// Qt includes
#include <QCloseEvent>
+#include <QtWebEngineWidgetsVersion>
// Local includes
@@ -51,8 +52,10 @@ WebWidget::WebWidget(QWidget* const parent)
d(new Private())
{
d->parent = parent;
+#if QTWEBENGINEWIDGETS_VERSION >= QT_VERSION_CHECK(5, 7, 0)
settings()->setAttribute(QWebEngineSettings::WebGLEnabled, false);
settings()->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, false);
+#endif
}
void WebWidget::closeEvent(QCloseEvent* event)
diff --git a/core/utilities/geolocation/geoiface/widgets/htmlwidget_qwebengine.cpp b/core/utilities/geolocation/geoiface/widgets/htmlwidget_qwebengine.cpp
index d7ce822..1671cb4 100644
--- a/core/utilities/geolocation/geoiface/widgets/htmlwidget_qwebengine.cpp
+++ b/core/utilities/geolocation/geoiface/widgets/htmlwidget_qwebengine.cpp
@@ -31,6 +31,7 @@
#include <QResizeEvent>
#include <QCoreApplication>
#include <QWebEngineSettings>
+#include <QtWebEngineWidgetsVersion>
// Local includes
@@ -121,8 +122,10 @@ HTMLWidget::HTMLWidget(QWidget* const parent)
d->parent = parent;
setAcceptDrops(false);
setFocusPolicy(Qt::WheelFocus);
+#if QTWEBENGINEWIDGETS_VERSION >= QT_VERSION_CHECK(5, 7, 0)
settings()->setAttribute(QWebEngineSettings::WebGLEnabled, false);
settings()->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, false);
+#endif
d->hpage = new HTMLWidgetPage(this);
setPage(d->hpage);
--
cgit v1.1