From 01b0988fc6052bf7cfd9cf0c6b1e7bb6cdb3b925 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sat, 10 Oct 2020 22:09:10 +0100 Subject: [PATCH] Remove usages of path where it should not be used --- dialog/file.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/dialog/file.go b/dialog/file.go index dccc1da5b0..c955a60c91 100644 --- a/dialog/file.go +++ b/dialog/file.go @@ -82,18 +82,18 @@ func (f *fileDialog) makeUI() fyne.CanvasObject { if f.file.save { callback := f.file.callback.(func(fyne.URIWriteCloser, error)) name := f.fileName.(*widget.Entry).Text - path, _ := storage.Child(f.dir, name) + location, _ := storage.Child(f.dir, name) - exists, _ := storage.Exists(path) + exists, _ := storage.Exists(location) - _, err := storage.ListerForURI(path) + _, err := storage.ListerForURI(location) if !exists { f.win.Hide() if f.file.onClosedCallback != nil { f.file.onClosedCallback(true) } - callback(storage.SaveFileToURI(path)) + callback(storage.SaveFileToURI(location)) return } else if err != nil { // check if the directory exists @@ -109,7 +109,7 @@ func (f *fileDialog) makeUI() fyne.CanvasObject { } f.win.Hide() - callback(storage.SaveFileToURI(path)) + callback(storage.SaveFileToURI(location)) if f.file.onClosedCallback != nil { f.file.onClosedCallback(true) } @@ -120,9 +120,7 @@ func (f *fileDialog) makeUI() fyne.CanvasObject { if f.file.onClosedCallback != nil { f.file.onClosedCallback(true) } - path := f.selected.location - // On windows replace '\\' with '/' - callback(storage.OpenFileFromURI(path)) + callback(storage.OpenFileFromURI(f.selected.location)) } }) f.open.Style = widget.PrimaryButton @@ -240,7 +238,7 @@ func (f *fileDialog) refreshDir(dir fyne.ListableURI) { files, err := dir.List() if err != nil { - fyne.LogError("Unable to read path "+dir.String(), err) + fyne.LogError("Unable to read ListableURI "+dir.String(), err) return }