~rjarry/aerc

a31606db0d4b4e44cf3ff7f6efc9165ccf27a23e — Tim Culverhouse 6 days ago aa01f0f
grid: remove unused method Children

The grid method Children returns the children of a grid, and is never
used. The function is reimplemented in both aerc.go and account.go, also
never called.

Remove these unused methods.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
3 files changed, 0 insertions(+), 19 deletions(-)

M lib/ui/grid.go
M widgets/account.go
M widgets/aerc.go
M lib/ui/grid.go => lib/ui/grid.go +0 -11
@@ 94,17 94,6 @@ func (grid *Grid) Columns(spec []GridSpec) *Grid {
	return grid
}

func (grid *Grid) Children() []Drawable {
	grid.mutex.RLock()
	defer grid.mutex.RUnlock()

	children := make([]Drawable, len(grid.cells))
	for i, cell := range grid.cells {
		children[i] = cell.Content
	}
	return children
}

func (grid *Grid) Draw(ctx *Context) {
	invalid := grid.invalid
	if invalid {

M widgets/account.go => widgets/account.go +0 -4
@@ 155,10 155,6 @@ func (acct *AccountView) Name() string {
	return acct.acct.Name
}

func (acct *AccountView) Children() []ui.Drawable {
	return acct.grid.Children()
}

func (acct *AccountView) OnInvalidate(onInvalidate func(d ui.Drawable)) {
	acct.grid.OnInvalidate(func(_ ui.Drawable) {
		onInvalidate(acct)

M widgets/aerc.go => widgets/aerc.go +0 -4
@@ 167,10 167,6 @@ func (aerc *Aerc) Tick() bool {
	return more
}

func (aerc *Aerc) Children() []ui.Drawable {
	return aerc.grid.Children()
}

func (aerc *Aerc) OnInvalidate(onInvalidate func(d ui.Drawable)) {
	aerc.grid.OnInvalidate(func(_ ui.Drawable) {
		onInvalidate(aerc)