fixing error in registerDefaults
This commit is contained in:
parent
5720a8e7d5
commit
8b447b9291
5 changed files with 68 additions and 1 deletions
|
@ -144,6 +144,21 @@ v8::Local<v8::Value> SystemPreferences::GetUserDefault(
|
|||
}
|
||||
}
|
||||
|
||||
void SystemPreferences::RegisterDefaults(mate::Arguments* args) {
|
||||
base::DictionaryValue value;
|
||||
|
||||
if(!args->GetNext(&value)) {
|
||||
args->ThrowError("Invalid userDefault data provided");
|
||||
} else {
|
||||
@try {
|
||||
NSDictionary* dict = DictionaryValueToNSDictionary(value);
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
|
||||
} @catch (NSException* exception) {
|
||||
args->ThrowError("Invalid userDefault data provided");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SystemPreferences::SetUserDefault(const std::string& name,
|
||||
const std::string& type,
|
||||
mate::Arguments* args) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue