Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: shell/src/FiltersCommand.cpp

Issue 10254076: API cleanup, get rid of JsObject and GetProperty() methods that don`t return JsValue (Closed)
Patch Set: Slightly better Filter/Subscription constructors Created April 26, 2013, 11:51 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/AdblockPlus/JsValue.h ('k') | shell/src/MatchesCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/src/FiltersCommand.cpp
===================================================================
--- a/shell/src/FiltersCommand.cpp
+++ b/shell/src/FiltersCommand.cpp
@@ -8,17 +8,17 @@ namespace
typedef std::vector<AdblockPlus::FilterPtr> FilterList;
void ShowFilterList(const FilterList& filters)
{
for (FilterList::const_iterator it = filters.begin();
it != filters.end(); it++)
{
std::string type;
- switch ((*it)->GetProperty("type", -1))
+ switch ((*it)->GetType())
{
case AdblockPlus::Filter::TYPE_BLOCKING:
type = "blocking";
break;
case AdblockPlus::Filter::TYPE_EXCEPTION:
type = "exception";
break;
case AdblockPlus::Filter::TYPE_ELEMHIDE:
@@ -32,17 +32,17 @@ namespace
break;
case AdblockPlus::Filter::TYPE_INVALID:
type = "invalid";
break;
default:
type = "(unknown type)";
break;
}
- std::cout << (*it)->GetProperty("text", "(no text)") << " - " <<
+ std::cout << (*it)->GetProperty("text")->AsString() << " - " <<
type << std::endl;
}
}
}
FiltersCommand::FiltersCommand(AdblockPlus::FilterEngine& filterEngine)
: Command("filters"), filterEngine(filterEngine)
{
« no previous file with comments | « include/AdblockPlus/JsValue.h ('k') | shell/src/MatchesCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld