mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-26 12:05:36 +01:00
Fix nvram theme setting
Themes with blank spaces in the middle was not possible. This commit fix it by quoting the string passed to nvrm
This commit is contained in:
parent
c8969630f3
commit
166dcaa7ba
@ -30,6 +30,12 @@ extension String {
|
|||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// - returns: A quoted string for nvram
|
||||||
|
var nvramString: String {
|
||||||
|
return "'\(self)'"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// - returns: Bool value indicating that our string start with the same prefix ignoring casing.
|
/// - returns: Bool value indicating that our string start with the same prefix ignoring casing.
|
||||||
func hasPrefixIgnoringCase(_ str: String) -> Bool {
|
func hasPrefixIgnoringCase(_ str: String) -> Bool {
|
||||||
return self.lowercased().hasPrefix(str.lowercased())
|
return self.lowercased().hasPrefix(str.lowercased())
|
||||||
|
@ -943,9 +943,9 @@ final class SettingsViewController:
|
|||||||
|
|
||||||
if nvramValue != theme {
|
if nvramValue != theme {
|
||||||
if theme.count == 0 {
|
if theme.count == 0 {
|
||||||
deleteNVRAM(key: key)
|
deleteNVRAM(key: key.nvramString)
|
||||||
} else {
|
} else {
|
||||||
setNVRAM(key: key, stringValue: theme)
|
setNVRAM(key: key, stringValue: theme.nvramString)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user