Parse Hidden and Example fields

This commit is contained in:
Sasha Koshka 2024-04-28 18:05:51 -04:00
parent a7a3e8b675
commit d82e802563

View File

@ -191,12 +191,24 @@ func parseThemeIndex (reader io.Reader) (theme Theme, parents []string, err erro
theme.Directories, err = parseDirectories(entry, file) theme.Directories, err = parseDirectories(entry, file)
if err != nil { return Theme { }, nil, err } if err != nil { return Theme { }, nil, err }
// ScaledDirectories // ScaledDirectories (optional)
if entry, ok := iconThemeGroup["ScaledDirectories"]; ok { if entry, ok := iconThemeGroup["ScaledDirectories"]; ok {
theme.ScaledDirectories, err = parseDirectories(entry, file) theme.ScaledDirectories, err = parseDirectories(entry, file)
if err != nil { return Theme { }, nil, err } if err != nil { return Theme { }, nil, err }
} }
// Hidden (optional)
if entry, ok := iconThemeGroup["Hidden"]; ok {
theme.Hidden, err = keyValue.ParseBoolean(entry.Value)
if err != nil { return Theme { }, nil, err }
}
// Example (optional)
if entry, ok := iconThemeGroup["Example"]; ok {
theme.Example, err = keyValue.ParseString(entry.Value)
if err != nil { return Theme { }, nil, err }
}
return theme, parents, nil return theme, parents, nil
} }