From ba20f9e892746639ebf888ef2e86add8839c3631 Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Mon, 18 Sep 2023 15:56:57 +0200 Subject: 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 --- src/core/web_contents_adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/web_contents_adapter.cpp') 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(); } -- cgit v1.2.3