invalidatable: cleanup dead code

Remove invalidatable type and all associated calls. All items can
directly invalidate the UI.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Tim Culverhouse 2022-10-07 11:00:31 -05:00 committed by Robin Jarry
parent 34014d3cee
commit ba24e92062
41 changed files with 76 additions and 303 deletions

View file

@ -10,6 +10,7 @@ import (
"github.com/emersion/go-message/mail"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/logging"
"git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/widgets"
@ -64,7 +65,7 @@ func (Compose) Execute(aerc *widgets.Aerc, args []string) error {
} else {
tab.Name = subject
}
tab.Content.Invalidate()
ui.Invalidate()
})
go func() {
defer logging.PanicHandler()

View file

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/widgets"
)
@ -34,13 +35,13 @@ func (NextPrevResult) Execute(aerc *widgets.Aerc, args []string) error {
if store != nil {
store.PrevResult()
}
acct.Messages().Invalidate()
ui.Invalidate()
} else {
store := acct.Store()
if store != nil {
store.NextResult()
}
acct.Messages().Invalidate()
ui.Invalidate()
}
return nil
}

View file

@ -6,6 +6,7 @@ import (
"strconv"
"strings"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/widgets"
)
@ -65,13 +66,13 @@ func ExecuteNextPrevMessage(args []string, acct *widgets.AccountView, pct bool,
store := acct.Store()
if store != nil {
store.NextPrev(-n)
acct.Messages().Invalidate()
ui.Invalidate()
}
} else {
store := acct.Store()
if store != nil {
store.NextPrev(n)
acct.Messages().Invalidate()
ui.Invalidate()
}
}
return nil

View file

@ -8,6 +8,7 @@ import (
"path/filepath"
"git.sr.ht/~rjarry/aerc/commands"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/logging"
"git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/widgets"
@ -110,7 +111,7 @@ func (Recover) Execute(aerc *widgets.Aerc, args []string) error {
tab := aerc.NewTab(composer, "Recovered")
composer.OnHeaderChange("Subject", func(subject string) {
tab.Name = subject
tab.Content.Invalidate()
ui.Invalidate()
})
go func() {
defer logging.PanicHandler()

View file

@ -5,6 +5,7 @@ import (
"strings"
"git.sr.ht/~rjarry/aerc/lib/statusline"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/logging"
"git.sr.ht/~rjarry/aerc/widgets"
"git.sr.ht/~rjarry/aerc/worker/types"
@ -54,7 +55,7 @@ func (SearchFilter) Execute(aerc *widgets.Aerc, args []string) error {
logging.Infof("Search results: %v", uids)
store.ApplySearch(uids)
// TODO: Remove when stores have multiple OnUpdate handlers
acct.Messages().Invalidate()
ui.Invalidate()
}
store.Search(args, cb)
}

View file

@ -9,6 +9,7 @@ import (
"git.sr.ht/~rjarry/aerc/commands"
"git.sr.ht/~rjarry/aerc/lib"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/logging"
"git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/widgets"
@ -117,7 +118,7 @@ func (Archive) Execute(aerc *widgets.Aerc, args []string) error {
if next == nil {
aerc.RemoveTab(h.msgProvider)
acct.Messages().Select(-1)
acct.Messages().Invalidate()
ui.Invalidate()
return
}
lib.NewMessageStoreView(next, mv.MessageView().SeenFlagSet(),

View file

@ -5,6 +5,7 @@ import (
"time"
"git.sr.ht/~rjarry/aerc/lib"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/widgets"
"git.sr.ht/~rjarry/aerc/worker/types"
@ -60,7 +61,7 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error {
if next == nil {
aerc.RemoveTab(h.msgProvider)
acct.Messages().Select(-1)
acct.Messages().Invalidate()
ui.Invalidate()
return
}
lib.NewMessageStoreView(next, mv.MessageView().SeenFlagSet(),

View file

@ -14,6 +14,7 @@ import (
"git.sr.ht/~rjarry/aerc/lib"
"git.sr.ht/~rjarry/aerc/lib/format"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/logging"
"git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/widgets"
@ -117,7 +118,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
} else {
tab.Name = subject
}
tab.Content.Invalidate()
ui.Invalidate()
})
return composer, nil
}

View file

@ -8,6 +8,7 @@ import (
"git.sr.ht/~rjarry/aerc/lib"
"git.sr.ht/~rjarry/aerc/lib/calendar"
"git.sr.ht/~rjarry/aerc/lib/format"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/logging"
"git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/widgets"
@ -167,7 +168,7 @@ func (invite) Execute(aerc *widgets.Aerc, args []string) error {
} else {
tab.Name = subject
}
tab.Content.Invalidate()
ui.Invalidate()
})
composer.OnClose(func(c *widgets.Composer) {

View file

@ -13,6 +13,7 @@ import (
"github.com/pkg/errors"
"git.sr.ht/~rjarry/aerc/lib"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/logging"
"git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/widgets"
@ -93,7 +94,7 @@ func (Recall) Execute(aerc *widgets.Aerc, args []string) error {
} else {
tab.Name = subject
}
tab.Content.Invalidate()
ui.Invalidate()
})
composer.OnClose(func(composer *widgets.Composer) {
worker := composer.Worker()

View file

@ -13,6 +13,7 @@ import (
"git.sr.ht/~rjarry/aerc/lib"
"git.sr.ht/~rjarry/aerc/lib/crypto"
"git.sr.ht/~rjarry/aerc/lib/format"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/logging"
"git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/widgets"
@ -194,7 +195,7 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
} else {
tab.Name = subject
}
tab.Content.Invalidate()
ui.Invalidate()
})
composer.OnClose(func(c *widgets.Composer) {

View file

@ -4,6 +4,7 @@ import (
"errors"
"git.sr.ht/~rjarry/aerc/lib/statusline"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/widgets"
)
@ -36,6 +37,6 @@ func (ToggleThreads) Execute(aerc *widgets.Aerc, args []string) error {
}
store.SetThreadedView(!store.ThreadedView())
acct.SetStatus(statusline.Threading(store.ThreadedView()))
acct.Messages().Invalidate()
ui.Invalidate()
return nil
}

View file

@ -9,6 +9,7 @@ import (
"time"
"git.sr.ht/~rjarry/aerc/lib"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/logging"
"git.sr.ht/~rjarry/aerc/models"
"git.sr.ht/~rjarry/aerc/widgets"
@ -168,7 +169,7 @@ func unsubscribeMailto(aerc *widgets.Aerc, u *url.URL) error {
} else {
tab.Name = subject
}
tab.Content.Invalidate()
ui.Invalidate()
})
composer.FocusTerminal()
return nil

View file

@ -5,6 +5,7 @@ import (
"github.com/riywo/loginshell"
"git.sr.ht/~rjarry/aerc/lib/ui"
"git.sr.ht/~rjarry/aerc/widgets"
)
@ -41,7 +42,7 @@ func TermCore(aerc *widgets.Aerc, args []string) error {
title = args[1]
}
tab.Name = title
tab.Content.Invalidate()
ui.Invalidate()
}
term.OnClose = func(err error) {
aerc.RemoveTab(term)