-
Bug
-
Resolution: Fixed
-
P4
-
9, 10
JFileChooserOperator.enterSubDir does not navigate to sub directory and instead goes to user's default directory.
The present code for JFileChooserOperator.enterSubDir(..) is
public File enterSubDir(String dir, StringComparator comparator) {
getQueueTool().waitEmpty();
selectFile(dir, comparator);
int index = findFileIndex(dir, comparator);
waitPainted(index);
setCurrentDirectory(getSelectedFile());
return getCurrentDirectory();
}
This first selects the directory, then tries to navigate to the selected directory by getting the patch of selcted directory from getSelectedFile(),
JFileChooserOperator.getSelectedFile() calls JFileChooser.getSelectedFile(), which returns the path for the selected file, but if the selection is a directory, then it returns Null.
This when passed to setCurrentDirectory() sets the diectory as user's default directory.
The present code for JFileChooserOperator.enterSubDir(..) is
public File enterSubDir(String dir, StringComparator comparator) {
getQueueTool().waitEmpty();
selectFile(dir, comparator);
int index = findFileIndex(dir, comparator);
waitPainted(index);
setCurrentDirectory(getSelectedFile());
return getCurrentDirectory();
}
This first selects the directory, then tries to navigate to the selected directory by getting the patch of selcted directory from getSelectedFile(),
JFileChooserOperator.getSelectedFile() calls JFileChooser.getSelectedFile(), which returns the path for the selected file, but if the selection is a directory, then it returns Null.
This when passed to setCurrentDirectory() sets the diectory as user's default directory.