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

[REG 5.14] QWebEngineDownloadItem::setPath() with filename creates extra directory

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 5.14
    • 5.14
    • WebEngine
    • None
    • 7ab606e2e4ed3655e9362276f14ede4846308097

    Description

      With the current 5.14 branch, doing e.g. setPath("/tmp/foo.txt") with a download item saves it to /tmp/foo.txt/foo.txt (i.e. there is an extra directory named like the file).

      I suspect this is due to https://codereview.qt-project.org/c/qt/qtwebengine/+/259146 which does this in setPath:

                  d->downloadDirectory = QFileInfo(path).filePath();
                  d->downloadFileName = QFileInfo(path).fileName();
      

      However, according to its documentation, QFileInfo::filePath() "returns the file name, including the path (which may be absolute or relative)."

      This should probably be something like QFileInfo(path).path() instead? (untested)

      Attachments

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

        Activity

          People

            ztamas Tamas Zakor
            the compiler Florian Bruhin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes