Add systemPreferences.removeUserDefault()
This can be used to restore the default or global value of a `key` previously set with `setUserDefault`.
This commit is contained in:
parent
30abdbccf8
commit
06d782279c
5 changed files with 35 additions and 4 deletions
|
@ -229,6 +229,11 @@ void SystemPreferences::SetUserDefault(const std::string& name,
|
|||
}
|
||||
}
|
||||
|
||||
void SystemPreferences::RemoveUserDefault(const std::string& name) {
|
||||
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
||||
[defaults removeObjectForKey:base::SysUTF8ToNSString(name)];
|
||||
}
|
||||
|
||||
bool SystemPreferences::IsDarkMode() {
|
||||
NSString* mode = [[NSUserDefaults standardUserDefaults]
|
||||
stringForKey:@"AppleInterfaceStyle"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue