Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.14.1
-
None
-
-
17ea5b6534d6221e50cdd37dc773e03b5d34665e (qt/qtwebengine/5.14)
Description
The setDownloadDirectory() uniquifies the file name if it is already exists in the provided download directory. setDownloadDirectory() shouldn't uniquify the filename if a custom file name has been set. The expected behavior is to overwrite the existing file if the custom download file name is the same.
In the following examples the suggested download file name is “download.txt”:
QObject::connect(profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) { item->setDownloadDirectory(“/tmp”); item->setDownloadFileName(“test.txt”); item->accept(); });
Expected result: “/tmp/test.txt”
Actual result: “/tmp/test.txt”
QObject::connect(profile, &QWebEngineProfile::downloadRequested, [&](QWebEngineDownloadItem *item) { item->setDownloadFileName(“test.txt”); item->setDownloadDirectory(“/tmp”); item->accept(); });
Expected result: “/tmp/test.txt”
Actual result: “/tmp/download.txt”
See https://cgit.kde.org/messagelib.git/commit/?id=2c113dcb155b11bf2c0af3c85544962485784b26 for details.