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

FileBrowser 'setRootDirectory' method bug with > 1 drive

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.4, 2.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows. Used daemon tools lite to simulate multiple drives.

      Description

      The FileBrowser 'setRootDirectory' method does not correctly work if more than one drive is present and the chosen root directory is on a drive other than the first logical drive.

      The problem appears to be in the following class:

      org.apache.pivot.wtk.skin.terra.TerraFileBrowserSkin

      The code is a bit hard to follow, but I think the problem is that the drive list button item is set in the "rootDirectoryChanged" method of the skin:

      driveListButton.setSelectedItem(drive);

      and this leads to setRootDirectory being called again for the root of the drive. Typically you want this to happen, but not when a root directory is in the process of being set.

      The bug manifests itself as the correct path being displayed in the file browser, but the files list is that of the root of the drive.

      I have a proposed fix that seems to work.

        Attachments

        1. TerraFileBrowserSkin.java.patch
          1 kB
          Oliver Oyston

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              oysol01 Oliver Oyston
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: