summaryrefslogtreecommitdiff
path: root/scan.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-25 13:10:23 -0600
committerJeff Carr <[email protected]>2024-02-25 13:10:23 -0600
commit9754e32858688a0add4beddb2837b0ddedc4a6bf (patch)
treef3817e590610fc71aa6b6d6e03f3e89297841055 /scan.go
parent6f3ec9e33895423535e3b2168cf74687df6eaf6e (diff)
cleaner code. some use of ENV
Diffstat (limited to 'scan.go')
-rw-r--r--scan.go25
1 files changed, 8 insertions, 17 deletions
diff --git a/scan.go b/scan.go
index 9dce2f5..811cee6 100644
--- a/scan.go
+++ b/scan.go
@@ -8,10 +8,6 @@ import (
"go.wit.com/log"
)
-func (r *RepoList) SetAutoScan(b bool) {
- me.autoScan = b
-}
-
func (r *RepoList) RegisterHideFunction(f func(*RepoRow)) {
me.hideFunction = f
}
@@ -25,11 +21,6 @@ func (r *RepoList) ScanRepositories() (int, string) {
i += 1
changed := repo.NewScan()
total += changed
- if me.hideFunction == nil {
- // application didn't register a hide function
- } else {
- me.hideFunction(repo)
- }
}
var hidden int
for _, repo := range me.allrepos {
@@ -60,6 +51,14 @@ func (r *RepoRow) NewScan() int {
// run the repostatus update
r.Status.Update()
+ if me.hideFunction == nil {
+ // application didn't register a hide function
+ // always show everything in that case
+ r.Show()
+ } else {
+ me.hideFunction(r)
+ }
+
// print out whatever changes have happened
if c, ok := r.Status.Changed(); ok {
log.Log(REPOWARN, "something finally changed")
@@ -70,13 +69,5 @@ func (r *RepoRow) NewScan() int {
}
}
- // hide or show repos based on the checkboxes
- if me.autoHidePerfect {
- if r.IsPerfect() {
- r.Hide()
- } else {
- r.Show()
- }
- }
return changed
}