func (f *fileDialog) setLocation(dir fyne.URI) error { does not work with non "file" repository #5207
Open
2 tasks done
Labels
bug
Something isn't working
Milestone
Checklist
Describe the bug
There is "file" respository specific code in fyne.io\fyne\[email protected]\dialog\file.go: func (f *fileDialog) setLocation(dir fyne.URI) error {}
Here is the code where the issue is:
newDir := storage.NewFileURI(buildDir)
isDir, err := storage.CanList(newDir)
if err != nil {
return err
}
Notice that setLocation takes a fyne URL as input (dir fyne.URI). If the fyne URL has a scheme of "file" then the call to storage.NewFileURI(buildDir) above will work. If the fyne URL in the parameter (dir fyne.URI) has a scheme different than "file". Then the call to storage.NewFileURI(buildDir) will return a URL with the "file" scheme instead of the scheme passed in dir fyne.URI.
I found this bug when trying to use the respository "httpfile" that I created.
How to reproduce
Create a non "file" repository.
Create a new file dialog pointing to the non "file" repository
Try traversing directories in the non "file" repository. The UI will stop once storage.NewFileURI(buildDir) resturns an invalid "file" URI.
Screenshots
No response
Example code
Create a new file dialog using the following code:
Fyne version
2.5.2
Go compiler version
1.23.1
Operating system and version
Windows 11
Additional Information
No response
The text was updated successfully, but these errors were encountered: