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

Sandboxed QFileDialog behaves inconsistently for saving

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.1.0 Beta 1
    • None
    • Mac OS X 10.8.3, Qt 5.1.0beta
    • macOS

    Description

      I'm seeing inconsistent behavior with a QFileDialog in AcceptSave mode when the application is sandboxed On Mac OS X 10.8.3. The situation is as follows:

      • Application is running in sandboxed mode
      • A QFileDialog is created, and its directory is set to the users Documents location, as given by QStandardPaths::standardLocations (In this case that function returns the documents folder within the application sandbox, rather than the users documents folder. Is that correct behavior?)
      • The user accepts the dialog without changing the displayed location (i.e. they save to the documents folder)

      The behavior i'm seeing is the following:

      • On the first attempt, the save window opens to my users documents folder, rather than the sandboxed documents folder specified by QStandardPaths. Upon clicking save my users documents folder is returned. This is at least desirable behavior, although not expected, as the path specified in the setDirectory() function was NOT the user level documents folder, but rather the sandboxed documents folder (I have verified that this is not just a symlink or the like)
      • If I then make a second attempt (without closing the application), I get the same display in the save window, but this time when I click save the path returned is that specified by QStandardPaths, and NOT my user level documents folder as displayed in the dialog.
      • On third and subsequent attempts, the save dialog comes up showing my user level documents folder as the current folder - but with a blank file listing. The save button returns the sandboxed documents folder

      NOTES:

      • This behavior is only observed when running sandboxed. When not sandboxed, the dialog behaves normally
      • If the user changes the directory selected, the correct directory is always displayed and returned. The inconsistent behavior is only when accepting the default location
      • I have attached a PNG showing the sequence of events, as well as the test code I used to create them

      Attachments

        1. Progression.png
          Progression.png
          463 kB
        2. TestFileDialog.zip
          7 kB

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              macavenger Israel Brewster
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes