summaryrefslogtreecommitdiff
path: root/scan.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-19 19:43:21 -0600
committerJeff Carr <[email protected]>2024-02-19 19:43:21 -0600
commit47d27e4166b960d7b84c9f6d974cc580843d59e9 (patch)
tree226b0ba7da4d42bc3d4e96fe600e76761d221db9 /scan.go
parent240da220878c0e24fc40f40c7ea16fff66250d4e (diff)
used a blind widget
Diffstat (limited to 'scan.go')
-rw-r--r--scan.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/scan.go b/scan.go
index 98ce4c9..baddf66 100644
--- a/scan.go
+++ b/scan.go
@@ -2,6 +2,7 @@ package repolist
import (
"fmt"
+ "strconv"
"strings"
"go.wit.com/log"
@@ -11,15 +12,37 @@ func (r *RepoList) SetAutoScan(b bool) {
me.autoScan = b
}
+func (r *RepoList) RegisterHideFunction(f func (* Repo)) {
+ me.hideFunction = f
+}
+
func (r *RepoList) ScanRepositories() (int, string) {
var i int
+ var shown int
t := TimeFunction(func() {
for _, repo := range me.allrepos {
i += 1
repo.NewScan()
+ if me.hideFunction == nil {
+ // application didn't register a hide function
+ } else {
+ me.hideFunction(repo)
+ }
+ }
+ var hidden int
+ for _, repo := range me.allrepos {
+ if repo.Hidden() {
+ hidden += 1
+ } else {
+ shown += 1
+ }
}
})
s := fmt.Sprint(t)
+ tmp := strconv.Itoa(shown) + " repos shown"
+ log.Info("Setting shownCount to", tmp)
+ me.shownCount.SetText(tmp)
+
log.Info("Scanned", i, "repositories. todo: count/show changes in", s)
return i, s
}