1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Use QTWEBENGINE_VERSION instead of QT_VERSION

Fixes build against separate QtWebEngine releases.
This commit is contained in:
David Rosca 2018-05-14 13:53:05 +02:00
parent 29fbbf5dc4
commit 9f0f688ee8
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
5 changed files with 6 additions and 8 deletions

View File

@ -45,7 +45,7 @@ add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER -DQT_NO_CAS
# Mandatory: Qt5
set(QT_MIN_VERSION "5.9.0")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets Network Sql QuickWidgets PrintSupport WebEngineWidgets WebChannel)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets Network Sql QuickWidgets PrintSupport WebEngine WebEngineWidgets WebChannel)
if (BUILD_TESTING)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test)
endif()
@ -85,8 +85,6 @@ if (WIN32)
add_definitions(-D_WIN32_WINNT=${ver})
endif()
set(HAVE_QTWEBENGINE_5_10 NOT Qt5WebEngineWidgets_VERSION VERSION_LESS 5.10.0)
# Mandatory: OpenSSL
find_package(OpenSSL REQUIRED)

View File

@ -9,6 +9,3 @@
/* Disable DBus support */
#cmakedefine DISABLE_DBUS
/* QtWebEngine is at least version 5.10 */
#cmakedefine01 HAVE_QTWEBENGINE_5_10

View File

@ -297,6 +297,9 @@ qt5_add_resources(SRCS
add_library(FalkonPrivate SHARED ${SRCS})
get_property(QT_WEBENGINE_INCLUDE_DIRS TARGET Qt5::WebEngine PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(FalkonPrivate SYSTEM PUBLIC ${QT_WEBENGINE_INCLUDE_DIRS})
target_link_libraries(FalkonPrivate
Qt5::Widgets
Qt5::WebEngineWidgets

View File

@ -20,6 +20,7 @@
#include <QDebug>
#include <QFlags>
#include <QtWebEngineVersion>
#ifdef FALKON_SHAREDLIBRARY
#define FALKON_EXPORT Q_DECL_EXPORT

View File

@ -35,7 +35,6 @@
#include "scripts.h"
#include "webhittestresult.h"
#include "webscrollbarmanager.h"
#include "../config.h"
#include <iostream>
@ -496,7 +495,7 @@ void WebView::copyLinkToClipboard()
void WebView::savePageAs()
{
#if HAVE_QTWEBENGINE_5_10
#if QTWEBENGINE_VERSION >= QT_VERSION_CHECK(5, 10, 0)
page()->runJavaScript(QSL("document.contentType"), WebPage::SafeJsWorld, [this](const QVariant &res) {
const QSet<QString> webPageTypes = {
QSL("text/html"),