Community
Participate
Working Groups
Created attachment 287773 [details] Fix for initial folder in FileDialog.open() Hi, after updating our application to Eclipse 2021-09 the setFilterPath does not work anymore. The directory used by the dialog seems to be random. I found out that this is probably caused by bug 571571. A fix could be adding fileDialog.ClearClientData() before calling fileDialog.SetDefaultFolder(psi) in FileDialog.open(): /* Set initial folder */ if (filterPath != null) { char[] path = (filterPath.replace('/', '\\') +"\0").toCharArray(); if (COM.SHCreateItemFromParsingName(path, 0, COM.IID_IShellItem,ppv) == COM.S_OK) { IShellItem psi = new IShellItem(ppv[0]) /* * SetDefaultFolder does not work if the dialog has * persisted recently used folder. The fix is to clear the * persisted data. */ fileDialog.ClearClientData(); fileDialog.SetDefaultFolder(psi); psi.Release(); } } I found this by comparing FileDialog with DirectoryDialog as mentioned in this stackoverflow question: https://stackoverflow.com/questions/18058575/set-the-initial-directory-in-swt-filedialog
@Nikita, could you please check?
Confirmed not working in 2012-12. Directory is not the one set in setFilterPath
*** This bug has been marked as a duplicate of bug 577190 ***