Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-80566

setDownloadDirectory() unsets custom download file name if called after setDownloadFileName()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.14.1, 5.15.0 Alpha
    • 5.14.1
    • WebEngine
    • None
    • All
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ztamas Tamas Zakor
            ztamas Tamas Zakor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes