From 4b2ac683b7725cec816e3e31f7512b7e3f082722 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 18 Mar 2025 15:13:55 -0500 Subject: [PATCH] start using IterBy() --- Makefile | 2 +- applyPatch.go | 2 +- windowRepos.go | 16 +++++++--------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index b238f1c..b84ee48 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ andlabs: clean install forge --gui andlabs gocui: install - forge --gui gocui --gui-verbose >/tmp/forge.log 2>&1 + forge --gui gocui --gui-verbose --gui-file ../../toolkits/gocui/gocui.so >/tmp/forge.log 2>&1 # forge --gui gocui --gui-verbose --debugger goimports: diff --git a/applyPatch.go b/applyPatch.go index 9abafef..8b05b18 100644 --- a/applyPatch.go +++ b/applyPatch.go @@ -160,7 +160,7 @@ func doRegister(newurl string) error { } test := strings.TrimSpace(string(body)) - for _, line := range strings.Split(test, "\n") { + for line := range strings.SplitSeq(test, "\n") { line = strings.TrimSpace(line) log.Info("server returned:", line) } diff --git a/windowRepos.go b/windowRepos.go index c647eff..98e13ad 100644 --- a/windowRepos.go +++ b/windowRepos.go @@ -25,9 +25,7 @@ func makeReposWin() *gadgets.GenericWindow { tb, box := makeStandardReposWindow("dirty repos", found) hbox := box.Box().Horizontal() hbox.NewButton("commit all", func() { - all := found.SortByFullPath() - for all.Scan() { - repo := all.Next() + for repo := range found.IterByFullPath() { log.Info("do commit here on", repo.GetGoPath()) } log.Info("TODO: fix this") @@ -55,9 +53,7 @@ func makeReposWin() *gadgets.GenericWindow { // make the window for the first time found := new(gitpb.Repos) - all := me.forge.Repos.SortByFullPath() - for all.Scan() { - repo := all.Next() + for repo := range me.forge.Repos.IterByFullPath() { if me.forge.Config.IsReadOnly(repo.GetGoPath()) { continue } @@ -367,9 +363,11 @@ func makeWritableWindow(pb *gitpb.Repos) (*gadgets.GenericWindow, *gitpb.ReposTa log.Info("todo: run git pull on each repo") }) - grid.NewButton("do repos.ReScan()", func() { - t.Update() - }) + /* + grid.NewButton("do repos.ReScan()", func() { + t.Update() + }) + */ tbox := win.Bottom.Box() t.SetParent(tbox)