Skip to content
Commit 9878ba8f authored by Stefano Crocco's avatar Stefano Crocco
Browse files

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
parent 51449ce9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment