Index: shell/src/PrefsCommand.cpp |
=================================================================== |
--- a/shell/src/PrefsCommand.cpp |
+++ b/shell/src/PrefsCommand.cpp |
@@ -36,53 +36,53 @@ |
return; |
} |
if (action == "show") |
{ |
std::string pref; |
argumentStream >> pref; |
- AdblockPlus::JsValuePtr value = filterEngine.GetPref(pref); |
- if (value->IsUndefined()) |
+ auto value = filterEngine.GetPref(pref); |
+ if (value.IsUndefined()) |
std::cout << "No such preference" << std::endl; |
else |
{ |
- if (value->IsString()) |
+ if (value.IsString()) |
std::cout << "(string) "; |
- else if (value->IsNumber()) |
+ else if (value.IsNumber()) |
std::cout << "(number) "; |
- else if (value->IsBool()) |
+ else if (value.IsBool()) |
std::cout << "(bool) "; |
else |
std::cout << "(unknown type) "; |
- std::cout << value->AsString() << std::endl; |
+ std::cout << value.AsString() << std::endl; |
} |
} |
else if (action == "set") |
{ |
std::string pref; |
argumentStream >> pref; |
- AdblockPlus::JsValuePtr current = filterEngine.GetPref(pref); |
- if (current->IsUndefined()) |
+ auto current = filterEngine.GetPref(pref); |
+ if (current.IsUndefined()) |
std::cout << "No such preference" << std::endl; |
- else if (current->IsString()) |
+ else if (current.IsString()) |
{ |
std::string value; |
std::getline(argumentStream, value); |
filterEngine.SetPref(pref, filterEngine.GetJsEngine()->NewValue(value)); |
} |
- else if (current->IsNumber()) |
+ else if (current.IsNumber()) |
{ |
int64_t value; |
argumentStream >> value; |
filterEngine.SetPref(pref, filterEngine.GetJsEngine()->NewValue(value)); |
} |
- else if (current->IsBool()) |
+ else if (current.IsBool()) |
{ |
bool value; |
argumentStream >> value; |
filterEngine.SetPref(pref, filterEngine.GetJsEngine()->NewValue(value)); |
} |
else |
std::cout << "Cannot set a preference of unknown type" << std::endl; |
} |