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

Unified Diff: shell/src/SubscriptionsCommand.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 | « shell/src/MatchesCommand.cpp ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/src/SubscriptionsCommand.cpp
===================================================================
--- a/shell/src/SubscriptionsCommand.cpp
+++ b/shell/src/SubscriptionsCommand.cpp
@@ -7,21 +7,22 @@ namespace
{
typedef std::vector<AdblockPlus::SubscriptionPtr> SubscriptionList;
void ShowSubscriptionList(const SubscriptionList& subscriptions)
{
for (SubscriptionList::const_iterator it = subscriptions.begin();
it != subscriptions.end(); it++)
{
- std::cout << (*it)->GetProperty("title", "(no title)") << " - " << (*it)->GetProperty("url", "");
- if ((*it)->GetProperty("author", "") != "")
- std::cout << " - " << (*it)->GetProperty("author", "");
- if ((*it)->GetProperty("specialization", "") != "")
- std::cout << " - " << (*it)->GetProperty("specialization", "");
+ std::cout << (*it)->GetProperty("title")->AsString();
+ std::cout << " - " << (*it)->GetProperty("url")->AsString();
+ if (!(*it)->GetProperty("author")->IsUndefined())
+ std::cout << " - " << (*it)->GetProperty("author")->AsString();
+ if (!(*it)->GetProperty("specialization")->IsUndefined())
+ std::cout << " - " << (*it)->GetProperty("specialization")->AsString();
std::cout << std::endl;
}
}
}
SubscriptionsCommand::SubscriptionsCommand(
AdblockPlus::FilterEngine& filterEngine)
: Command("subscriptions"), filterEngine(filterEngine)
« no previous file with comments | « shell/src/MatchesCommand.cpp ('k') | src/FilterEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld