Open GoogleCodeExporter opened 9 years ago
After some browsing of the code, the source of this bug seems to be
in GTKFileChooserUI:
------------------
private void doDirectoryChanged(File olddir, File newdir, Object source) {
if (getFileChooser().getCurrentDirectory().equals(newdir)) {
// to avoid repeated invocations on the same directory.
return;
}
[...]
-------------------
See line 1256 in com/google/code/gtkjfilechooser/ui/GtkFileChooserUI.java
The value of newdir should be compared to the value of olddir, but instead it
is compared to the value of the currentDirectory field of the file chooser.
The property change that triggers invocation of doDirectoryChanged is fired
from JFileChooser.setCurrentDirectory, which has already set the file chooser's
currentDirectory field to newdir, so the .equals method call always returns
true and doDirectoryChanged returns without doing anything.
The method should be modified like this:
---------------------
private void doDirectoryChanged(File olddir, File newdir, Object source) {
if (olddir != null ? olddir.equals(newdir) : newdir == null) {
// to avoid repeated invocations on the same directory.
return;
}
[...]
---------------------
Original comment by mchaber...@biometricgroup.com
on 23 Jan 2013 at 9:29
Original issue reported on code.google.com by
stroebel...@gmail.com
on 14 Nov 2012 at 11:58