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

QFile::moveToTrash() does not accept relative path on Windows

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.15.0 Beta4
    • Fix Version/s: 5.15.1
    • Component/s: Core: I/O
    • Labels:
      None
    • Environment:
      Windows 10
    • Platform/s:
      Windows
    • Commits:
      a033c23ddffed6b9bff3e7be68d513a7962c3b5e (qt/qtbase/dev) 40c571cd727cf0eb8523dc063030fa6cad57c8a3 (qt/qtbase/5.15)

      Description

      QFile::moveToTrash(path) works with absolute path but not with relative path on Windows.

      #include <QDebug>
      #include <QFile>
      
      int main()
      {
          QString fn = "aaa.txt";
          {
              QFile f(fn);
              f.open(QFile::WriteOnly);
          }
          qDebug() << QFile::moveToTrash(fn);
      }
      

      This outputs false but when absolute path is used, the same code outputs true.

        Attachments

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

          Activity

            People

            Assignee:
            vhilshei Volker Hilsheimer
            Reporter:
            vladimir.kraus Vladimir Kraus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes