Icon theme parsing properly stores rooted dir paths
This commit is contained in:
parent
c465ff6d1e
commit
39e6d0187e
@ -133,7 +133,9 @@ func findTheme (name string, trail []string, warn bool, path ...string) (Theme,
|
||||
for index, directory := range theme.Directories {
|
||||
directory.Paths = make([]string, len(instances))
|
||||
for pathIndex, path := range directory.Paths {
|
||||
directory.Paths[pathIndex] = filepath.Join(path, directory.Name)
|
||||
directory.Paths[pathIndex] = filepath.Join (
|
||||
instances[pathIndex],
|
||||
path, directory.Name)
|
||||
}
|
||||
theme.Directories[index] = directory
|
||||
}
|
||||
@ -329,7 +331,8 @@ func (theme Theme) findIconHere (name string, size, scale int, supported ...Icon
|
||||
if directory.Fits(size, scale) {
|
||||
for _, path := range directory.Paths {
|
||||
for _, ty := range supported {
|
||||
icon, err := parseIcon(filepath.Join(path, ty.Extend(name)))
|
||||
icon, err := parseIcon(filepath.Join (
|
||||
path, ty.Extend(name)))
|
||||
if err == nil { return icon, err }
|
||||
}
|
||||
}
|
||||
@ -344,7 +347,8 @@ func (theme Theme) findIconHere (name string, size, scale int, supported ...Icon
|
||||
if sizeDistance < minimalDistance {
|
||||
for _, path := range directory.Paths {
|
||||
for _, ty := range supported {
|
||||
iconFilename := filepath.Join(path, ty.Extend(name))
|
||||
iconFilename := filepath.Join (
|
||||
path, ty.Extend(name))
|
||||
if _, err := os.Stat(iconFilename); err == nil {
|
||||
closestFilename = iconFilename
|
||||
minimalDistance = sizeDistance
|
||||
|
Loading…
Reference in New Issue
Block a user