Fix false circular dependencies

This commit is contained in:
Sasha Koshka 2024-04-28 17:58:31 -04:00
parent c3487af9b8
commit a7a3e8b675

View File

@ -136,7 +136,7 @@ func findTheme (name string, trail []string, warn bool, path ...string) (Theme,
// parse parents
for _, parent := range parents {
parentTheme, err := findTheme(name, trail, warn, path...)
parentTheme, err := findTheme(parent, trail, warn, path...)
if err != nil {
if warn {
log.Printf (
@ -149,8 +149,8 @@ func findTheme (name string, trail []string, warn bool, path ...string) (Theme,
}
// if no parents were successfuly parsed, inherit from hicolor
if theme.Inherits == nil {
hicolor, err := findTheme(name, trail, warn, path...)
if theme.Inherits == nil && name != "hicolor" {
hicolor, err := findTheme("hicolor", trail, warn, path...)
if err != nil { return Theme { }, err }
theme.Inherits = []Theme { hicolor }
}
@ -179,7 +179,7 @@ func parseThemeIndex (reader io.Reader) (theme Theme, parents []string, err erro
// Inherits (optional)
if entry, ok := iconThemeGroup["Inherits"]; ok {
parents, err = keyValue.ParseMultiple (
parents, err = keyValue.ParseMultipleComma (
keyValue.ParseString,
entry.Value)
if !ok { return Theme { }, nil, err }