Skip to content

Commit

Permalink
Deprecations of driver and remove old URI.Name()
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Jan 13, 2021
1 parent 4849b1d commit 24e1c32
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
6 changes: 6 additions & 0 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ type Driver interface {

// FileReaderForURI opens a file reader for the given resource indicator.
// This may refer to a filesystem (typical on desktop) or data from another application.
//
// Deprecated: this has been replaced by storage.Reader(URI)
FileReaderForURI(URI) (URIReadCloser, error)

// FileWriterForURI opens a file writer for the given resource indicator.
// This should refer to a filesystem resource as external data will not be writable.
//
// Deprecated: this has been replaced by storage.Writer(URI)
FileWriterForURI(URI) (URIWriteCloser, error)

// ListerForURI converts a URI to a listable URI, if it is possible to do so.
//
// Deprecated: this has been replaced by storage.List(URI)
ListerForURI(URI) (ListableURI, error)

// CanvasForObject returns the canvas that is associated with a given CanvasObject.
Expand Down
4 changes: 0 additions & 4 deletions internal/driver/glfw/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ func (d *gLDriver) FileReaderForURI(uri fyne.URI) (fyne.URIReadCloser, error) {
return openFile(uri, false)
}

func (f *file) Name() string {
return f.URI().Name()
}

func (f *file) URI() fyne.URI {
return storage.NewURI("file://" + f.path)
}
Expand Down
4 changes: 0 additions & 4 deletions internal/driver/gomobile/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ type fileOpen struct {
done func()
}

func (f *fileOpen) Name() string {
return f.uri.Name()
}

func (f *fileOpen) URI() fyne.URI {
return f.uri
}
Expand Down
5 changes: 0 additions & 5 deletions internal/repository/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ func (n *nodeReaderWriter) Write(p []byte) (int, error) {
return count, nil
}

// Name implements fyne.URI*Closer.Name
func (n *nodeReaderWriter) Name() string {
return n.URI().Name()
}

// Name implements fyne.URI*Closer.URI
func (n *nodeReaderWriter) URI() fyne.URI {

Expand Down
6 changes: 2 additions & 4 deletions uri.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ import (
// It may refer to an item on a filesystem or data in another application that we have access to.
type URIReadCloser interface {
io.ReadCloser
// Deprecated, use URI().Name() instead
Name() string

URI() URI
}

// URIWriteCloser represents a cross platform data writer for a file resource.
// This will normally refer to a local file resource.
type URIWriteCloser interface {
io.WriteCloser
// Deprecated, use URI().Name() instead
Name() string

URI() URI
}

Expand Down

0 comments on commit 24e1c32

Please sign in to comment.