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