Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1998

Allow QFile.copy() method to overwrite file by having allow_overwrite argument

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 6.x
    • PySide
    • None
    • Every platform that Qt supports is affected by QFile not having such an ability to overwrite a file.

    • All

    Description

      I suggest a parameter named allow_overwrite be added to the instance method and also to the static method of QFile.

       

      So, a developer could then do...

      QFile.copy("path/source_file.extension", "path/target_file.extension", allow_overwrite=True)

      or

      file_manager = QFile("path/source_file.extension")

      file_manager.copy("path/target_file.extension", allow_overwrite=True)

       

      It's cumbersome that if we need to overwrite a file, we must remove the target file - if it exists by checking with QFile.exists("path/target_file.extension") - and then do a copy. For large files or files from the Internet, this introduces an overhead.

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            pedantichacker Boštjan Mejak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes