[rkward/work/qtwebengine] /: Merge branch 'master' into work/qtwebengine

Thomas Friedrichsmeier null at kde.org
Sun Mar 29 17:05:00 BST 2020


Git commit b6ac452ef18dc10f54d2104867f7aa3a5884d942 by Thomas Friedrichsmeier.
Committed on 29/03/2020 at 16:04.
Pushed by tfry into branch 'work/qtwebengine'.

Merge branch 'master' into work/qtwebengine

M  +4    -2    CMakeLists.txt
M  +119  -70   rkward/windows/rkhtmlwindow.cpp
M  +8    -6    rkward/windows/rkhtmlwindow.h

https://commits.kde.org/rkward/b6ac452ef18dc10f54d2104867f7aa3a5884d942

diff --cc CMakeLists.txt
index 3889e956,e8b78563..619a4ce2
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@@ -17,22 -17,12 +17,24 @@@ INCLUDE(KDEInstallDirs
  INCLUDE(KDECMakeSettings)
  INCLUDE(KDECompilerSettings)
  INCLUDE(ECMInstallIcons)
+ INCLUDE(ECMAddAppIcon)
+ INCLUDE(ECMMarkNonGuiExecutable)
  INCLUDE(FeatureSummary)
  
 -FIND_PACKAGE(Qt5 5.2 CONFIG REQUIRED COMPONENTS Widgets Core Xml Network WebKitWidgets Script PrintSupport)
 -FIND_PACKAGE(KF5 5.4 REQUIRED COMPONENTS CoreAddons DocTools I18n XmlGui TextEditor WidgetsAddons WebKit Parts Config Notifications WindowSystem OPTIONAL_COMPONENTS Crash)
 +FIND_PACKAGE(Qt5 5.2 CONFIG REQUIRED COMPONENTS Widgets Core Xml Network Script PrintSupport)
- FIND_PACKAGE(KF5 5.2 REQUIRED COMPONENTS CoreAddons DocTools I18n XmlGui TextEditor WidgetsAddons Parts Config Notifications WindowSystem)
++FIND_PACKAGE(KF5 5.2 REQUIRED COMPONENTS CoreAddons DocTools I18n XmlGui TextEditor WidgetsAddons Parts Config Notifications WindowSystem OPTIONAL_COMPONENTS Crash)
 +IF(NOT NO_QT_WEBENGINE)
 +	FIND_PACKAGE(Qt5 OPTIONAL_COMPONENTS WebEngine)
 +ENDIF(NOT NoQtWebEngine)
 +IF(NOT Qt5WebEngine_FOUND)
 +	FIND_PACKAGE(KF5 5.2 OPTIONAL_COMPONENTS WebKit)
 +	IF(NOT KF5_WebKit_FOUND)
 +		MESSAGE(FATAL_ERROR "At least one of KF5WebKit or QtWebEngine is required. Neither was found on this system.")
 +	ENDIF(NOT KF5_WebKit_FOUND)
 +	ADD_DEFINITIONS(-DNO_QT_WEBENGINE)  # TODO: rather set it for rkhtmlwindow, only
 +ELSE(Qt5WebEngine_FOUND)
 +	MESSAGE(STATUS "QtWebEngine will be used for rendering HTML. To use KF5WebKit, instead (if available), pass -DNO_QT_WEBENGINE in your call to cmake.")
 +ENDIF(Qt5WebEngine_FOUND)
  FIND_PACKAGE(Gettext REQUIRED)
  
  # FindIntl in cmake is broken for MSVC on Windows, (and only included from 3.2.3 upwards).
diff --cc rkward/windows/rkhtmlwindow.cpp
index 42636db2,ccb88b1b..7709696d
--- a/rkward/windows/rkhtmlwindow.cpp
+++ b/rkward/windows/rkhtmlwindow.cpp
@@@ -62,16 -66,10 +63,17 @@@
  #include "../windows/rkworkplaceview.h"
  #include "../debug.h"
  
 +#ifdef NO_QT_WEBENGINE
 +#	include <QWebFrame>
 +#	include <QNetworkRequest>
 +#	include <kwebview.h>
- // TODO: We used to have KioIntegration in addition to KPartsIntegration. But this is just buggy, buggy, buggy in KF5 5.9.0. (e.g. navigation to previous
- // // page in history just doesn't work).
- RKWebPage::RKWebPage (RKHTMLWindow* window): KWebPage (window, KPartsIntegration) {
+ // NOTE: According to an earlier note at this place, KIOIntegration used to be very buggy around KF5 5.9.0. It seem to just work,
+ //       at 5.44.0, and the symptoms are probably not terrible for earlier versions, so we use it here (allows us to render help:/-pages
+ //       inside the help window.
+ RKWebPage::RKWebPage (RKHTMLWindow* window): KWebPage (window, KPartsIntegration | KIOIntegration) {
 +#else
 +RKWebPage::RKWebPage (RKHTMLWindow* window): QWebEnginePage (window) {
 +#endif
  	RK_TRACE (APP);
  	RKWebPage::window = window;
  	new_window = false;
@@@ -104,13 -97,13 +106,13 @@@ bool RKWebPage::acceptNavigationReques
  		return false;
  	}
  
 -	if (frame != mainFrame ()) {
 +	if (!is_main_frame) {
- 		if (navurl.isLocalFile () && (QMimeDatabase ().mimeTypeForUrl (navurl).inherits ("text/html"))) return true;
+ 		if (request.url ().isLocalFile () && supportsContentType(QMimeDatabase ().mimeTypeForUrl (request.url ()).name ())) return true;
  	}
  
 -	if (QUrl (mainFrame ()->url ()).matches (request.url (), QUrl::NormalizePathSegments | QUrl::StripTrailingSlash)) {
 -		RK_DEBUG (APP, DL_DEBUG, "Page internal navigation request from %s to %s", qPrintable (mainFrame ()->url ().toString ()), qPrintable (request.url ().toString ()));
 -		emit (pageInternalNavigation (request.url ()));
 +	if (cururl.matches (navurl, QUrl::NormalizePathSegments | QUrl::StripTrailingSlash)) {
 +		RK_DEBUG (APP, DL_DEBUG, "Page internal navigation request from %s to %s", qPrintable (cururl.toString ()), qPrintable (navurl.toString ()));
 +		emit (pageInternalNavigation (navurl));
  		return true;
  	}
  



More information about the rkward-tracker mailing list