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

Allow QFile.copy() to already existing file (make it compatible with QTemporaryFile)

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • None
    • Core: I/O
    • None

    Description

      The simple idea to copy a file to a temporary file will not work with the following code:

      QFile* source_file;
      ...
      QTemporaryFile* tmp_file = new QTemporaryFile();
      tmp_file->open(); tmp_file->close(); //make name

      source_file->copy(tmp_file->fileName());

      Because tmp_file->open() generates an empty file, which lets QFile.copy() fail.

      Solution: allow copy() to already existing files (overwrite mode).

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            mscheerer Martin Scheerer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes