diff options
author | Tamas Zakor <ztamas@inf.u-szeged.hu> | 2019-05-09 14:49:56 +0200 |
---|---|---|
committer | Tamas Zakor <ztamas@inf.u-szeged.hu> | 2019-05-16 11:57:07 +0000 |
commit | a4eeb9dbd995d598bd3a639dd450def7c242b383 (patch) | |
tree | 99d1b0fe8fa64be15948b601960c54e5b632783b /src/core/download_manager_delegate_qt.cpp | |
parent | 0c2beb49b858f49489fa4f1ecee6bfdd6ce57e68 (diff) |
Add API to get the suggested download file name
[ChangeLog][DownloadItem] Add functions and property
to get the suggested download file name.
Task-number: QTBUG-56978
Change-Id: I902870c6358271322da613a15ccc11639384e404
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/download_manager_delegate_qt.cpp')
-rw-r--r-- | src/core/download_manager_delegate_qt.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp index 2af958068..ba506601f 100644 --- a/src/core/download_manager_delegate_qt.cpp +++ b/src/core/download_manager_delegate_qt.cpp @@ -208,7 +208,8 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem* false /* done */, downloadType, item->GetLastReason(), - adapterClient + adapterClient, + suggestedFilename }; for (ProfileAdapterClient *client : qAsConst(clients)) { @@ -309,7 +310,9 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content false, /* done */ ProfileAdapterClient::SavePage, ProfileAdapterClient::NoReason, - adapterClient + adapterClient, + QFileInfo(suggestedFilePath).fileName() + }; for (ProfileAdapterClient *client : qAsConst(clients)) { @@ -375,7 +378,8 @@ void DownloadManagerDelegateQt::OnDownloadUpdated(download::DownloadItem *downlo download->IsDone(), 0 /* downloadType (unused) */, download->GetLastReason(), - adapterClient + adapterClient, + toQt(download->GetSuggestedFilename()) }; for (ProfileAdapterClient *client : qAsConst(clients)) { |