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

QFileDialog::getSaveFileName() does not ask for confirmation to overwrite files.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 4.6.2
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Scratchbox 1.0
      Maemo PR 1.2
      Maemo 5 SDK - updated to PR 1.2

      Description

      When the static call QFileDialog::getSaveFileName() is used, and the file name typed in by the user matches the name of a file in the same folder, the overwrite confirmation dialog is not displayed.

      How to reproduce:

      1) Use the main.cpp file attached to this issue and create a project for it: qmake - project
      2) Create a text file in the same folder where the binary is, e.g. test.txt
      3) Run the application, either on ScratchBox emulator or the device.
      4) When the "Save File As.." dialog appears, type in the same file name used in #, e.g. test.txt

      Expected result:

      • A dialog with the message "File <x> already exists; Do you wish to overwrite it?" should appear.

      Actual result:

      • No dialog is displayed, and the file name is returned as valid even though it already exists on the file system and the user has not explicitly chosen to overwrite it. In the example application, you will see something like:

      "/home/user/file/etc/test.txt" - this is the file name yielded by the dialog
      true - this shows this file already exists

      Observation:

      1) When the same code is run on Windows and Linux, the overwrite confirmation dialog is displayed. See attached png file for details.
      2) This is a case of automatic failure in Ovi Store QA tests.
      3) A workaround is present in main.cpp.

        Attachments

        1. linux.png
          linux.png
          196 kB
        2. main.cpp
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              dohollan Dominik Holland (closed Nokia identity) (Inactive)
              Reporter:
              dcrocha Daniel Rocha
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes