Restore ability to view help pages from Konqueror
ClosedPublic

Authored by stefanocrocco on Jul 19 2018, 1:08 PM.

Details

Summary

A generic QWebEngineUrlSchemeHandler which takes data from KIO::storedGet has been added and is now used also for man and info URLs. The old WebEnginePartHtmlMimetypeHandler has been changed into a class which only embeds the content of file URLs in the HTML code.

I found out that several calls to QWebEngineUrlSchemeHandler::requestStarted may happen before the previous one has replied (it happened for the help protocol where the HTML code produced by KIO in turn contained help URLs). Because of this, I needed to implement a queuing mechanism in the new handler.

The new handler can be used as a base class if special processing of data produced by KIO is needed

Test Plan
  • check that man pages displayed with WebEnginePart look as when displayed by KHTML (es: man:/cp)
  • check that help pages displayed with WebEnginePart look as when displayed by KHTML (es help:/kate)

Diff Detail

Repository
R226 Konqueror
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
stefanocrocco requested review of this revision.Jul 19 2018, 1:08 PM
stefanocrocco created this revision.
stefanocrocco edited the summary of this revision. (Show Details)Aug 2 2018, 7:42 AM
stefanocrocco edited the test plan for this revision. (Show Details)

Any news about this?

dfaure requested changes to this revision.Aug 2 2018, 8:20 AM
This revision now requires changes to proceed.Aug 2 2018, 8:20 AM

I see that you requested changes, but I can't see which changes

dfaure added inline comments.Aug 2 2018, 10:08 AM
webenginepart/src/webengineparthtmlembedder.cpp
131

Strange, this comment got lost.

I think QEventLoop is very dangerous. A HTML redirection timer could fire while in that loop, destroying the page/view/whatever, and if that deletes the HtmlEmbedded as well, this will crash.

Any chance to make this asynchronous instead?

stefanocrocco added inline comments.Aug 2 2018, 10:15 AM
webenginepart/src/webengineparthtmlembedder.cpp
131

Yes, it can be done. I'll look into it later today

Don't use an inner event loop

dfaure accepted this revision.Aug 4 2018, 8:54 AM

Very nice.

webenginepart/src/webengineparthtmlembedder.cpp
36

remove

webenginepart/src/webenginepartkiohandler.cpp
72

Minor: this if() is in fact redundant, the while+if that follow take care of this case already.

98

coding style: join with previous line?

This revision is now accepted and ready to land.Aug 4 2018, 8:54 AM
This revision was automatically updated to reflect the committed changes.

Hi @stefanocrocco. I just came across your nice fixes for webenginepart to improve kio support, Thanks for those.

But sadly there there is some glitch here in the license headers for the new files you added:

  • broken mix of text for GPL & LGPL
  • inconsistency in license with rest of source files

Could you help everyone in fixing this up by changing this license header to match the rest of webenginepart sources? Same for some other files you added in other commits. You can grep for "GNU General Public License" to find all of them.

I just submitted review D18227 with the license fixes. I believe I copied the license from some other Konqueror source file which uses GPL and didn't notice that WebEnginePart files use LGPL instead.

I just submitted review D18227 with the license fixes. I believe I copied the license from some other Konqueror source file which uses GPL and didn't notice that WebEnginePart files use LGPL instead.

Thanks for fixing :)