Fix issue with info protocol and refresh

Authored by stefanocrocco on Aug 4 2018, 9:14 PM.

Description

Fix issue with info protocol and refresh

Summary:
In certain cases, the info ioslave need to redirect to another URL (for instance, info:cp is redirected to info:/coreutils/cp invocation). To do so the ioslave produces an HTML page with a <meta> element having a content-type=refresh attribute which points to the correct URL.

This causes a significant problem with the WebEnginePartHtmlEmbedder: this class uses a QWebEnginePage to parse the HTML, but QWebEnginePage does much more than just parsing the HTML and tries to actually refresh the page. This means that the loadFinished signal is emitted more than once, one for the original code and another for the refresh. Due to everything QWebEnginePage does being asynchronous, this somehow (I couldn't exactly understand what's happening) causes an error message saying that the page doesn't exist (I guess that QWebEnginePage enter a loop which it forcefully breaks after a few iterations).

Disconnecting the QWebEnginePage::loadFinished signal the first time it's emitted and connecting to it again from WebEnginePartHtmlEmbedder::startEmbedding seems to solve the issue (at least most of the times).

Test Plan: enter the info:cp URL and check that the correct page (info:/coreutils/cp invocation) is displayed

Reviewers: dfaure

Reviewed By: dfaure

Differential Revision: https://phabricator.kde.org/D14614

Details

Committed
stefanocroccoAug 5 2018, 4:19 AM
Reviewer
dfaure
Differential Revision
D14614: Fix issue with info protocol and refresh
Parents
R226:51449ce98a86: Restore ability to view help pages from Konqueror
Branches
Unknown
Tags
Unknown