diff options
author | Szabolcs David <davidsz@inf.u-szeged.hu> | 2023-09-18 15:56:57 +0200 |
---|---|---|
committer | Szabolcs David <davidsz@inf.u-szeged.hu> | 2023-09-28 10:09:28 +0200 |
commit | ba20f9e892746639ebf888ef2e86add8839c3631 (patch) | |
tree | 26444fb29735f6ce02563fb2a31a25b88c78a27e /src/core/web_contents_adapter.cpp | |
parent | b4b709a5d9f44b3d16ae42c7831dcd45c64c1c30 (diff) |
Improve QWebEngineDownloadRequest::isSavePageDownload()
WebContentsImpl::IsSavable() decides which file formats are saveable,
but it allows this only for text-based files. All other files will go
around on the code path of downloading. MHTML (multipart) and PDF files
are saved like this, which means they aren't marked as isSavePageDownload.
Just simply set this flag if the save was requested by the user even if
it was a download.
This fixes the flag for saving MHTML and PDF files from context menu,
and leaves the flag false when a PDF download was initiated by the
button of the web UI.
Pick-to: 6.6
Task-number: QTBUG-114859
Change-Id: Id65f26a96952c5a43876338ad37f40570e544f3a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 7e13064b3..31a3ab93c 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -754,7 +754,7 @@ void WebContentsAdapter::save(const QString &filePath, int savePageFormat) { CHECK_INITIALIZED(); base::RecordAction(base::UserMetricsAction("SavePage")); - m_webContentsDelegate->setSavePageInfo(SavePageInfo(filePath, savePageFormat)); + m_webContentsDelegate->setSavePageInfo(new SavePageInfo(filePath, savePageFormat)); m_webContents->OnSavePage(); } |