Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-832

FileBrowserSheet.setRootDirectory(...) fails the first time on drives other than system volume

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0, 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows

      Description

      Let the system volumen be C:. If FileBrowserSheet.setRootDirectory is called with a path on a different drive (<volume>:\the\path), on the first time root directory is set to "<volume>:" instead of "<volume>:\the\path".

      I was not sure if it had to do with the patch I provided (it's also in 2.0), so I analized the behavior. It's caused by a strange loop of listeners:

      • If FileBrowserSheet.setRootDirectory is called this triggers the fileBrowserSheetListeners.
      • One of the listeners is TerraFileBrowserSkin.rootDirectoryChanged.
      • In this method driveListButton.setSelectedItem is called with the new drive.
      • This triggers the listButtonSelectionListeners of the driveListButton,
      • One of the listeners triggers FileBrowser.setRootDirectory with this newly "selected" drive, so rootdirectory is set to this drive instead of the given path for this drive.

      Workaround: calling FileBrowserSheet.setRootDirectory twice in the application breaks the circle, because FileBrowser.setRootDirectory is not triggered again from driveListButton.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                smartini Sandro Martini
                Reporter:
                vseibt Volker Seibt
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: