mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 02:22:13 +08:00
4bec912831
[testing]
129 lines
4.8 KiB
Diff
129 lines
4.8 KiB
Diff
From ed8cb6bbebae11a992b707ad509183c4762d8696 Mon Sep 17 00:00:00 2001
|
|
From: Gary Holmlund <gary.holmlund@gmail.com>
|
|
Date: Tue, 5 Jun 2018 17:14:59 -0700
|
|
Subject: [PATCH] Fix bug #140, No window text with Qt 5.11
|
|
|
|
---
|
|
ChangeLog | 3 +++
|
|
src/frontend/btwebenginepage.cpp | 9 ++++++---
|
|
2 files changed, 9 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/frontend/btwebenginepage.cpp b/src/frontend/btwebenginepage.cpp
|
|
index c818789de..584a6d5d3 100644
|
|
--- a/src/frontend/btwebenginepage.cpp
|
|
+++ b/src/frontend/btwebenginepage.cpp
|
|
@@ -35,9 +35,12 @@ BtWebEnginePage::BtWebEnginePage(QObject *parent)
|
|
}
|
|
|
|
bool BtWebEnginePage::acceptNavigationRequest(
|
|
- const QUrl& url, NavigationType /*type*/, bool /*isMainFrame*/) {
|
|
- emit linkClicked(url);
|
|
- return false;
|
|
+ const QUrl& url, NavigationType type, bool isMainFrame) {
|
|
+ if (type == QWebEnginePage::NavigationTypeLinkClicked) {
|
|
+ emit linkClicked(url);
|
|
+ return false;
|
|
+ }
|
|
+ return QWebEnginePage::acceptNavigationRequest(url, type, isMainFrame);
|
|
}
|
|
|
|
void BtWebEnginePage::addJavaScriptObject(const QString &name, QObject *object) {
|
|
From 517d5be1f4c9e3eaad66a6a44c15e43f4d41b08e Mon Sep 17 00:00:00 2001
|
|
From: Gary Holmlund <gary.holmlund@gmail.com>
|
|
Date: Tue, 5 Jun 2018 17:12:14 -0700
|
|
Subject: [PATCH] Fix cmake errors with Qt 5.11 and some cmake warnings.
|
|
|
|
---
|
|
CMakeLists.txt | 16 ++++++++++++----
|
|
ChangeLog | 3 +++
|
|
cmake/BTTests.cmake | 9 ++-------
|
|
3 files changed, 17 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 27236aa7c..2b2f6c382 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -1,5 +1,6 @@
|
|
PROJECT(bibletime CXX C)
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
|
|
+CMAKE_POLICY(SET CMP0028 NEW)
|
|
|
|
IF("${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
MESSAGE(FATAL_ERROR "You probably didn't mean to run CMake from this directory. Now you have all messed up! You'd better delete CMakeFiles/ and CMakeCache.txt or things will break!")
|
|
@@ -121,6 +122,10 @@ FIND_PACKAGE(Qt5Core REQUIRED)
|
|
FIND_PACKAGE(Qt5LinguistTools REQUIRED)
|
|
FIND_PACKAGE(Qt5Gui REQUIRED)
|
|
FIND_PACKAGE(Qt5Widgets REQUIRED)
|
|
+FIND_PACKAGE(Qt5Xml REQUIRED)
|
|
+FIND_PACKAGE(Qt5Test REQUIRED)
|
|
+FIND_PACKAGE(Qt5Svg REQUIRED)
|
|
+FIND_PACKAGE(Qt5PrintSupport REQUIRED)
|
|
|
|
FIND_PACKAGE(CLucene REQUIRED)
|
|
FIND_PACKAGE(Sword 1.7.0 REQUIRED)
|
|
@@ -154,9 +159,12 @@ ENDIF()
|
|
FIND_PACKAGE(Qt5WebEngine QUIET)
|
|
IF(NOT Qt5WebEngine_FOUND)
|
|
MESSAGE(STATUS "Using Qt WebKit")
|
|
+ FIND_PACKAGE(Qt5WebKit REQUIRED)
|
|
+ FIND_PACKAGE(Qt5WebKitWidgets REQUIRED)
|
|
SET(USEWEBENGINE OFF)
|
|
ELSE()
|
|
MESSAGE(STATUS "Using Qt WebEngine")
|
|
+ FIND_PACKAGE(Qt5WebEngineWidgets REQUIRED)
|
|
SET(USEWEBENGINE ON)
|
|
ENDIF()
|
|
|
|
@@ -194,7 +202,7 @@ ADD_LIBRARY(
|
|
STATIC
|
|
${bibletime_COMMON_SOURCES}
|
|
)
|
|
-QT5_USE_MODULES(bibletime_common Widgets Xml)
|
|
+TARGET_LINK_LIBRARIES(bibletime_common Qt5::Widgets Qt5::Xml)
|
|
|
|
IF(MSVC)
|
|
ADD_EXECUTABLE("bibletime" WIN32 ${common_bibletime_SOURCES})
|
|
@@ -222,11 +230,11 @@ TARGET_LINK_LIBRARIES("bibletime"
|
|
)
|
|
|
|
IF(${BIBLETIME_FRONTEND} STREQUAL "MOBILE")
|
|
- qt5_use_modules("bibletime" Widgets WebKitWidgets Qml Quick Xml Network PrintSupport Svg)
|
|
+ TARGET_LINK_LIBRARIES("bibletime" Qt5::Widgets Qt5::WebKitWidgets Qt5::Qml Qt5::Quick Qt5::Xml Qt5::Network Qt5::PrintSupport Qt5::Svg)
|
|
ELSEIF(USEWEBENGINE)
|
|
- qt5_use_modules("bibletime" Widgets WebEngine WebEngineWidgets WebChannel Xml Network PrintSupport Svg)
|
|
+ TARGET_LINK_LIBRARIES("bibletime" Qt5::Widgets Qt5::WebEngine Qt5::WebEngineWidgets Qt5::WebChannel Qt5::Xml Qt5::Network Qt5::PrintSupport Qt5::Svg)
|
|
ELSE()
|
|
- qt5_use_modules("bibletime" Widgets WebKit WebKitWidgets Xml Network PrintSupport Svg)
|
|
+ TARGET_LINK_LIBRARIES("bibletime" Qt5::Widgets Qt5::WebKit Qt5::WebKitWidgets Qt5::Xml Qt5::Network Qt5::PrintSupport Qt5::Svg)
|
|
ENDIF()
|
|
|
|
SET(BibleTime_LDFLAGS "")
|
|
diff --git a/cmake/BTTests.cmake b/cmake/BTTests.cmake
|
|
index c3e7aa7d8..aac7eb713 100644
|
|
--- a/cmake/BTTests.cmake
|
|
+++ b/cmake/BTTests.cmake
|
|
@@ -1,11 +1,6 @@
|
|
|
|
ENABLE_TESTING(true)
|
|
|
|
-QT5_ADD_RESOURCES(test_RESOURCE_SOURCES
|
|
- ${bibletime_SOURCE_DIR}/src/mobile/btm.qrc
|
|
- ${bibletime_SOURCE_DIR}/i18n/messages/test_translate.qrc
|
|
-)
|
|
-
|
|
SET(test_OTHER_SOURCES
|
|
${bibletime_SOURCE_DIR}/src/frontend/messagedialog.cpp
|
|
)
|
|
@@ -15,10 +10,9 @@ FUNCTION(test_a_class testDir testClass )
|
|
${testDir}/test_${testClass}.cpp
|
|
${test_OTHER_SOURCES}
|
|
${test_${testClass}_MOC_SRC}
|
|
- ${test_RESOURCE_SOURCES}
|
|
)
|
|
SET_TARGET_PROPERTIES("test_${testClass}" PROPERTIES COMPILE_FLAGS ${Sword_CFLAGS_OTHER} -std=c++11 )
|
|
- QT5_USE_MODULES(test_${testClass} Widgets Xml Network Test)
|
|
+ TARGET_LINK_LIBRARIES(test_${testClass} Qt5::Widgets Qt5::Xml Qt5::Network Qt5::Test)
|
|
TARGET_LINK_LIBRARIES(test_${testClass}
|
|
bibletime_common
|
|
${Sword_LDFLAGS}
|