Avoid automatically displaying local URLs in WebEnginePart
ClosedPublic

Authored by stefanocrocco on Jan 4 2020, 11:51 AM.

Details

Summary

When a file URL is passed to WebEnginePage::acceptNavigationRequest,
don't allow QtWebEngine to decide what to do with it (open it in the
QWebEnginePage or not) but let Konqueror make the choice according to
the user's configuration.

Whitout this change, clicking on the "Home" link in the introduction
page (konq:konqueror) opens the page in WebEnginePart, while it should
open it in DolphinPart (or whichever part the user has chosen to display
directories).

Test Plan

from the introduction page (konq:konqueror) click the "Home Folder"
link and check that the home folder is opened in DolphinPart and not
WebEnginePart. Create an HTML file with a link to a local image file, open the
HTML file in Konqueror and click on the link to the image. check that the image
is opened in the part chosen to handle images.

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.Jan 4 2020, 11:51 AM
stefanocrocco created this revision.
dfaure accepted this revision.Jan 4 2020, 5:02 PM
dfaure added inline comments.
webenginepart/src/webenginepage.cpp
196
if (url.isLocalFile()) {
This revision is now accepted and ready to land.Jan 4 2020, 5:02 PM
dfaure added a comment.Jan 4 2020, 5:03 PM

from the introduction page (konq:konqueror)

BTW, how about renaming that to konq:about? It will seem less redundant than konq:konqueror.

This revision was automatically updated to reflect the committed changes.