fixed being able to select non folder things and also hid .folders aswell
This commit is contained in:
16
main.go
16
main.go
@@ -5,6 +5,8 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"s1d3sw1ped/cpms/admin"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/app"
|
||||
@@ -146,7 +148,19 @@ func scanProfiles(profilesroot string) []string {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
return m
|
||||
mm := []string{}
|
||||
|
||||
for _, path := range m {
|
||||
if s, err := os.Stat(path); err == nil && !strings.HasPrefix(s.Name(), ".") && s.IsDir() {
|
||||
mm = append(mm, path)
|
||||
}
|
||||
}
|
||||
|
||||
slices.SortStableFunc(mm, func(a, b string) int {
|
||||
return strings.Compare(a, b)
|
||||
})
|
||||
|
||||
return mm
|
||||
}
|
||||
|
||||
func makeIFunc(profile, archive string, parent fyne.Window) func() {
|
||||
|
||||
Reference in New Issue
Block a user