Use QWebEngineDownloadItem::page() if possible
ClosedPublic

Authored by stefanocrocco on Jul 4 2019, 2:02 PM.

Details

Summary

Starting from Qt 5.12.0, QWebEngineDownloadItem knows which page
requested the download, so there's no more need to record calls to
WebEnginePage::acceptNavigationRequest and use them to try to guess the
correct page.

WebEngineDownloadManager still keeps a list of all pages because,
according to the documentation, QWebEngineDownloadItem::page() can
return nullptr "if the download was not triggered by content in a page".
If this happens, one of the pages (chosen arbitrarily) is used.

Test Plan

Compile Konqueror using Qt 5.12.0 or later, try to download a file and check
that it happens correctly

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 4 2019, 2:02 PM
stefanocrocco created this revision.
dfaure accepted this revision.Jul 5 2019, 6:14 AM
This revision is now accepted and ready to land.Jul 5 2019, 6:14 AM
This revision was automatically updated to reflect the committed changes.