Fix an issue when viewing info pages
AbandonedPublic

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

Details

Reviewers
dfaure
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 info page
(info:/coreutils/cp invocation) is displayed

Diff Detail

Repository
R226 Konqueror
Branch
help-protocol
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1521
Build 1539: arc lint + arc unit
stefanocrocco requested review of this revision.Aug 4 2018, 9:05 PM
stefanocrocco created this revision.
stefanocrocco abandoned this revision.Aug 4 2018, 9:06 PM